Skip to content

Commit

Permalink
f2fs: fix wrong block count instead of bytes
Browse files Browse the repository at this point in the history
We should convert cur_lblock, a block count, to bytes for len.

Fixes: af4b6b8 ("f2fs: introduce check_swap_activate_fast()")
Reviewed-by: Chao Yu <[email protected]>
Signed-off-by: Jaegeuk Kim <[email protected]>
  • Loading branch information
Jaegeuk Kim committed Dec 3, 2020
1 parent 43b9d4b commit 963ba7f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/f2fs/data.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/*
Expand All @@ -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);
Expand Down

0 comments on commit 963ba7f

Please sign in to comment.