aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaegeuk Kim2020-11-24 17:09:07 -0600
committerJaegeuk Kim2020-12-21 15:33:15 -0600
commitd763d7a72c25b7d6648f40a64ea3367971387d8e (patch)
treeafc7c3eeddf07357e058a46fdc70831e65a8676b
parent366d9ab986603ebdb56958775ad6bd0afc40d25c (diff)
downloadkernel-d763d7a72c25b7d6648f40a64ea3367971387d8e.tar.gz
kernel-d763d7a72c25b7d6648f40a64ea3367971387d8e.tar.xz
kernel-d763d7a72c25b7d6648f40a64ea3367971387d8e.zip
f2fs: fix wrong block count instead of bytes
We should convert cur_lblock, a block count, to bytes for len. Fixes: af4b6b8edf6a ("f2fs: introduce check_swap_activate_fast()") Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r--fs/f2fs/data.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index a84e5bc09337..e49c14ccfafe 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -3893,7 +3893,7 @@ static int check_swap_activate_fast(struct swap_info_struct *sis,
3893 sector_t highest_pblock = 0; 3893 sector_t highest_pblock = 0;
3894 int nr_extents = 0; 3894 int nr_extents = 0;
3895 unsigned long nr_pblocks; 3895 unsigned long nr_pblocks;
3896 unsigned long len; 3896 u64 len;
3897 int ret; 3897 int ret;
3898 3898
3899 /* 3899 /*
@@ -3911,7 +3911,7 @@ static int check_swap_activate_fast(struct swap_info_struct *sis,
3911 cond_resched(); 3911 cond_resched();
3912 3912
3913 memset(&map_bh, 0, sizeof(struct buffer_head)); 3913 memset(&map_bh, 0, sizeof(struct buffer_head));
3914 map_bh.b_size = len - cur_lblock; 3914 map_bh.b_size = len - blks_to_bytes(inode, cur_lblock);
3915 3915
3916 ret = get_data_block(inode, cur_lblock, &map_bh, 0, 3916 ret = get_data_block(inode, cur_lblock, &map_bh, 0,
3917 F2FS_GET_BLOCK_FIEMAP, &next_pgofs); 3917 F2FS_GET_BLOCK_FIEMAP, &next_pgofs);