diff options
author | Jens Axboe <axboe@kernel.dk> | 2021-03-02 14:53:21 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-03-07 12:20:49 +0100 |
commit | 60fdceaa91ad3bd7d7171b7280492d7438492d5c (patch) | |
tree | 9ce78046383a82595fe5118c154675bc4e02ac33 /mm/page_io.c | |
parent | bebf5e8327799cfb27c5c0c361b943b0f0e0a2d7 (diff) |
swap: fix swapfile read/write offset
commit caf6912f3f4af7232340d500a4a2008f81b93f14 upstream.
We're not factoring in the start of the file for where to write and
read the swapfile, which leads to very unfortunate side effects of
writing where we should not be...
Fixes: dd6bd0d9c7db ("swap: use bdev_read_page() / bdev_write_page()")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Cc: Anthony Iliopoulos <ailiop@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'mm/page_io.c')
-rw-r--r-- | mm/page_io.c | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/mm/page_io.c b/mm/page_io.c index 60a66a58b9bf..bcf27d057253 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -260,11 +260,6 @@ out: return ret; } -static sector_t swap_page_sector(struct page *page) -{ - return (sector_t)__page_file_index(page) << (PAGE_SHIFT - 9); -} - static inline void count_swpout_vm_event(struct page *page) { #ifdef CONFIG_TRANSPARENT_HUGEPAGE |