mirror of
https://gitee.com/openharmony/third_party_f2fs-tools
synced 2024-11-23 10:10:00 +00:00
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:
parent
890e9b325d
commit
5e056bef17
@ -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);
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user