Skip to contentSkip to conversation

resize.f2fs: modify condition for resize

PATCH New Yunlei He 1 participant 1 message Nov 7, 2016

lore
Share & tools
lore

Yunlei He

author
#0 lore raw

PATCH 1/1 resize.f2fs: modify condition for resize

it better to decide resize or not by sector num.

---
 fsck/main.c   | 4 ++--
 fsck/resize.c | 5 -----
 2 files changed, 2 insertions(+), 7 deletions(-)
fsck/main.c +2 -2
index 7e8fdf3..64537cc 100644
@@ -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);
fsck/resize.c +0 -5
index 7691524..46aa30e 100644
@@ -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,
Signature · 9 lines
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