summary refs log tree commit diff
path: root/fs/f2fs/data.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2020-11-24 15:09:07 -0800
committerJaegeuk Kim <jaegeuk@kernel.org>2020-12-02 22:00:22 -0800
commit963ba7f983767d79e914cd616c3e57be1938677e (patch)
treeb432bb4ad4f5e2d5aa347e76afc7b10adf9db461 /fs/f2fs/data.c
parent43b9d4b4d91c02ca1159507d46e3687d98b4cb8f (diff)
downloadlinux-963ba7f983767d79e914cd616c3e57be1938677e.tar.gz
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>
Diffstat (limited to 'fs/f2fs/data.c')
-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,
 	sector_t highest_pblock = 0;
 	int nr_extents = 0;
 	unsigned long nr_pblocks;
-	unsigned long len;
+	u64 len;
 	int ret;
 
 	/*
@@ -3911,7 +3911,7 @@ static int check_swap_activate_fast(struct swap_info_struct *sis,
 		cond_resched();
 
 		memset(&map_bh, 0, sizeof(struct buffer_head));
-		map_bh.b_size = len - cur_lblock;
+		map_bh.b_size = len - blks_to_bytes(inode, cur_lblock);
 
 		ret = get_data_block(inode, cur_lblock, &map_bh, 0,
 					F2FS_GET_BLOCK_FIEMAP, &next_pgofs);