]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
f2fs: fix last_lblock check in check_swap_activate_fast
authorhuangjianan@oppo.com <huangjianan@oppo.com>
Sat, 27 Feb 2021 12:02:30 +0000 (20:02 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Fri, 12 Mar 2021 21:16:43 +0000 (13:16 -0800)
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 <huangjianan@oppo.com>
Signed-off-by: Guo Weichao <guoweichao@oppo.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/data.c

index 1531463768bf6d401a45bb770fc0e6904a23e4ff..398498fb99d59922a243a8f1f341fcb6090d1cb2 100644 (file)
@@ -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;