Commit 963ba7f9 authored by Jaegeuk Kim's avatar Jaegeuk Kim

f2fs: fix wrong block count instead of bytes

We should convert cur_lblock, a block count, to bytes for len.

Fixes: af4b6b8e ("f2fs: introduce check_swap_activate_fast()")
Reviewed-by: default avatarChao Yu <yuchao0@huawei.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 43b9d4b4
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment