swap: fix swapfile read/write offset
authorJens Axboe <axboe@kernel.dk>
Tue, 2 Mar 2021 21:53:21 +0000 (14:53 -0700)
committerJens Axboe <axboe@kernel.dk>
Wed, 3 Mar 2021 00:25:46 +0000 (17:25 -0700)
commitcaf6912f3f4af7232340d500a4a2008f81b93f14
tree64099ad5cba8855452bb5eb518da72a5bac3855a
parentf5f4fc4649ae542b1a25670b17aaf3cbb6187acc
swap: fix swapfile read/write offset

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: 48d15436fde6 ("mm: remove get_swap_bio")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
include/linux/swap.h
mm/page_io.c
mm/swapfile.c