resize.f2fs: fix a resize fail for sector size mismatch

This patch fix a resize faill for sector size mismatch.
The initial fs comes from an image file, with sector size
512KB, and the block device sector size is equal to block
size.

Signed-off-by: Yunlei He <heyunlei@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
Yunlei He 2017-03-08 20:20:54 +08:00 committed by Jaegeuk Kim
parent 52a3a273d1
commit 78ad88d1d2

View File

@ -537,8 +537,9 @@ static int do_resize(struct f2fs_sb_info *sbi)
return -1;
}
if (c.target_sectors <=
(get_sb(block_count) << get_sb(log_sectors_per_block))) {
/* may different sector size */
if ((c.target_sectors * c.sector_size >>
get_sb(log_blocksize)) <= get_sb(block_count)) {
ASSERT_MSG("Nothing to resize, now only support resize to expand\n");
return -1;
}