it better to decide resize or not by sector num. Signed-off-by: Yunlei He <heyun...@huawei.com> --- fsck/main.c | 4 ++-- fsck/resize.c | 5 ----- 2 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/fsck/main.c b/fsck/main.c index 7e8fdf3..64537cc 100644 --- a/fsck/main.c +++ b/fsck/main.c @@ -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); diff --git a/fsck/resize.c b/fsck/resize.c index 7691524..46aa30e 100644 --- a/fsck/resize.c +++ b/fsck/resize.c @@ -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, -- 2.10.1 ------------------------------------------------------------------------------ Developer Access Program for Intel Xeon Phi Processors Access to Intel Xeon Phi processor-based developer platforms. With one year of Intel Parallel Studio XE. Training and support from Colfax. Order your platform today. http://sdm.link/xeonphi _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel