mirror of
https://gitee.com/openharmony/third_party_f2fs-tools
synced 2024-11-23 10:10:00 +00:00
resize.f2fs: add force option to rewrite broken calculation
This patch adds "-f" for resize.f2fs to fix broken resized f2fs. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
parent
f056fbeff0
commit
98e64635bd
@ -506,7 +506,7 @@ void f2fs_parse_options(int argc, char *argv[])
|
||||
#endif
|
||||
} else if (!strcmp("resize.f2fs", prog)) {
|
||||
#ifdef WITH_RESIZE
|
||||
const char *option_string = "d:st:iV";
|
||||
const char *option_string = "d:fst:iV";
|
||||
|
||||
c.func = RESIZE;
|
||||
while ((option = getopt(argc, argv, option_string)) != EOF) {
|
||||
@ -522,6 +522,10 @@ void f2fs_parse_options(int argc, char *argv[])
|
||||
MSG(0, "Info: Debug level = %d\n",
|
||||
c.dbg_lv);
|
||||
break;
|
||||
case 'f':
|
||||
c.force = 1;
|
||||
MSG(0, "Info: Force to resize\n");
|
||||
break;
|
||||
case 's':
|
||||
c.safe_resize = 1;
|
||||
break;
|
||||
|
@ -714,8 +714,9 @@ int f2fs_resize(struct f2fs_sb_info *sbi)
|
||||
} else {
|
||||
return f2fs_resize_shrink(sbi);
|
||||
}
|
||||
else if ((c.target_sectors * c.sector_size >>
|
||||
get_sb(log_blocksize)) > get_sb(block_count))
|
||||
else if (((c.target_sectors * c.sector_size >>
|
||||
get_sb(log_blocksize)) > get_sb(block_count)) ||
|
||||
c.force)
|
||||
return f2fs_resize_grow(sbi);
|
||||
else {
|
||||
MSG(0, "Nothing to resize.\n");
|
||||
|
Loading…
Reference in New Issue
Block a user