Steve French bfc8e67c60 SMB3: fix readpage for large swap cache
commit f2a26a3cff27dfa456fef386fe5df56dcb4b47b6 upstream.

readpage was calculating the offset of the page incorrectly
for the case of large swapcaches.

    loff_t offset = (loff_t)page->index << PAGE_SHIFT;

As pointed out by Matthew Wilcox, this needs to use
page_file_offset() to calculate the offset instead.
Pages coming from the swap cache have page->index set
to their index within the swapcache, not within the backing
file.  For a sufficiently large swapcache, we could have
overlapping values of page->index within the same backing file.

Suggested by: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: <stable@vger.kernel.org> # v5.7+
Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-04 12:46:45 +02:00
..
2020-10-22 12:17:52 -05:00
2020-06-01 00:10:18 -05:00
2020-11-15 23:05:33 -06:00
2020-06-01 00:10:18 -05:00
2021-01-19 18:27:19 +01:00
2021-08-04 12:46:45 +02:00
2020-07-09 10:06:52 -05:00
2020-10-22 12:16:24 -05:00
2020-08-02 18:00:25 -05:00
2007-06-05 18:30:44 +00:00
2020-06-01 00:10:18 -05:00
2019-01-24 09:37:33 -06:00