resize.f2fs: modify condition for resize

it better to decide resize or not by sector num.

Signed-off-by: Yunlei He <heyunlei@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
Yunlei He 2016-11-07 21:25:58 +08:00 committed by Jaegeuk Kim
parent 890e9b325d
commit 5e056bef17
2 changed files with 2 additions and 7 deletions

View File

@ -444,9 +444,9 @@ static int do_resize(struct f2fs_sb_info *sbi)
return -1;
}
if (c.target_sectors ==
if (c.target_sectors <=
(get_sb(block_count) << get_sb(log_sectors_per_block))) {
ASSERT_MSG("Nothing to resize; it's same");
ASSERT_MSG("Nothing to resize, now only support resize to expand\n");
return -1;
}
return f2fs_resize(sbi);

View File

@ -579,11 +579,6 @@ int f2fs_resize(struct f2fs_sb_info *sbi)
end_blkaddr = (get_sb(segment_count_main) <<
get_sb(log_blocks_per_seg)) + get_sb(main_blkaddr);
if (old_main_blkaddr > new_main_blkaddr) {
MSG(0, "\tError: Support resize to expand only\n");
return -1;
}
err = -EAGAIN;
if (new_main_blkaddr < end_blkaddr) {
err = f2fs_defragment(sbi, old_main_blkaddr, offset,