From: huangjianan@oppo.com Date: Sat, 27 Feb 2021 12:02:30 +0000 (+0800) Subject: f2fs: fix last_lblock check in check_swap_activate_fast X-Git-Tag: v5.13-rc1~53^2~36 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1da66103837077df70ddf7a49c46dfd025001a60;p=thirdparty%2Fkernel%2Flinux.git f2fs: fix last_lblock check in check_swap_activate_fast Because page_no < sis->max guarantees that the while loop break out normally, the wrong check contidion here doesn't cause a problem. Signed-off-by: Huang Jianan Signed-off-by: Guo Weichao Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim --- diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 1531463768bf6..398498fb99d59 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -3803,7 +3803,7 @@ static int check_swap_activate_fast(struct swap_info_struct *sis, last_lblock = bytes_to_blks(inode, i_size_read(inode)); len = i_size_read(inode); - while (cur_lblock <= last_lblock && cur_lblock < sis->max) { + while (cur_lblock < last_lblock && cur_lblock < sis->max) { struct f2fs_map_blocks map; pgoff_t next_pgofs;