Commit db155f74 authored by Jens Axboe's avatar Jens Axboe Committed by Zheng Zengkai
Browse files

swap: fix swapfile read/write offset



stable inclusion
from stable-5.10.21
commit 04b049ac9cb4eb425998f690fbd416757a7c9b15
bugzilla: 50609

--------------------------------

commit caf6912f 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: dd6bd0d9 ("swap: use bdev_read_page() / bdev_write_page()")
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
Cc: Anthony Iliopoulos <ailiop@suse.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarChen Jun <chenjun102@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 327f5790
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment