summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorhuangjianan@oppo.com <huangjianan@oppo.com>2021-02-27 20:02:30 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2021-03-12 13:16:43 -0800
commit1da66103837077df70ddf7a49c46dfd025001a60 (patch)
tree9a87e4584fe7dd9f8a5f150628647ab0c61c671b /fs
parentebc29b62a166e9116cd8159e9798044d02130279 (diff)
downloadlinux-stable-1da66103837077df70ddf7a49c46dfd025001a60.tar.gz
linux-stable-1da66103837077df70ddf7a49c46dfd025001a60.tar.bz2
linux-stable-1da66103837077df70ddf7a49c46dfd025001a60.zip
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 <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>
Diffstat (limited to 'fs')
-rw-r--r--fs/f2fs/data.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 1531463768bf..398498fb99d5 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;