All of lore.kernel.org
 help / color / mirror / Atom feed
* [f2fs-dev] [PATCH v2] resize.f2fs: add -g to give default options
@ 2025-11-24  8:42 Yangyang Zang
  2025-11-24 11:26 ` Sheng Yong
  2025-11-25  1:26 ` Chao Yu via Linux-f2fs-devel
  0 siblings, 2 replies; 3+ messages in thread
From: Yangyang Zang @ 2025-11-24  8:42 UTC (permalink / raw)
  To: chao, jaegeuk; +Cc: Yangyang Zang, linux-f2fs-devel

Commit 42482e81248f ("resize.f2fs: add caution message for resize")
introduced the `-F' option to force resizing f2fs without displaying
the caution message. And `add_default_options()` implies that `-g'
enables `-F' for resize by default. However resize.f2fs does not
currently support the `-g' option. This patch adds `-g' for it.

Fixes: 42482e81248f ("resize.f2fs: add caution message for resize")
Signed-off-by: Yangyang Zang <zangyangyang1@xiaomi.com>
---
Changes in v2:
 - Modify the commit message as suggested by shengyong
---
 fsck/main.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/fsck/main.c b/fsck/main.c
index f7ef092..08d38d8 100644
--- a/fsck/main.c
+++ b/fsck/main.c
@@ -145,6 +145,9 @@ void resize_usage()
 	MSG(0, "[options]:\n");
 	MSG(0, "  -d debug level [default:0]\n");
 	MSG(0, "  -H support write hint\n");
+	MSG(0, "  -f ignore errors during resize\n");
+	MSG(0, "  -F force to resize\n");
+	MSG(0, "  -g add default options\n");
 	MSG(0, "  -o overprovision percentage [default:auto]\n");
 	MSG(0, "  -s safe resize (Does not resize metadata)\n");
 	MSG(0, "  -t target sectors [default: device size]\n");
@@ -640,7 +643,7 @@ void f2fs_parse_options(int argc, char *argv[])
 #endif
 	} else if (!strcmp("resize.f2fs", prog)) {
 #ifdef WITH_RESIZE
-		const char *option_string = "d:fFHst:o:V";
+		const char *option_string = "d:fFg:Hst:o:V";
 
 		c.func = RESIZE;
 		while ((option = getopt(argc, argv, option_string)) != EOF) {
@@ -664,6 +667,12 @@ void f2fs_parse_options(int argc, char *argv[])
 				c.force = 1;
 				MSG(0, "Info: Force to resize\n");
 				break;
+                        case 'g':
+                                if (!strcmp(optarg, "android")) {
+                                        c.defset = CONF_ANDROID;
+                                        MSG(0, "Info: Set conf for android\n");
+                                }
+                                break;
 			case 'H':
 				c.need_whint = true;
 				c.whint = WRITE_LIFE_NOT_SET;
-- 
2.43.2



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [f2fs-dev] [PATCH v2] resize.f2fs: add -g to give default options
  2025-11-24  8:42 [f2fs-dev] [PATCH v2] resize.f2fs: add -g to give default options Yangyang Zang
@ 2025-11-24 11:26 ` Sheng Yong
  2025-11-25  1:26 ` Chao Yu via Linux-f2fs-devel
  1 sibling, 0 replies; 3+ messages in thread
From: Sheng Yong @ 2025-11-24 11:26 UTC (permalink / raw)
  To: Yangyang Zang, chao, jaegeuk; +Cc: shengyong1, Yangyang Zang, linux-f2fs-devel

On 11/24/25 16:42, Yangyang Zang wrote:
> Commit 42482e81248f ("resize.f2fs: add caution message for resize")
> introduced the `-F' option to force resizing f2fs without displaying
> the caution message. And `add_default_options()` implies that `-g'
> enables `-F' for resize by default. However resize.f2fs does not
> currently support the `-g' option. This patch adds `-g' for it.
> 
> Fixes: 42482e81248f ("resize.f2fs: add caution message for resize")
> Signed-off-by: Yangyang Zang <zangyangyang1@xiaomi.com>

Reviewed-by: Sheng Yong <shengyong1@xiaomi.com>



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [f2fs-dev] [PATCH v2] resize.f2fs: add -g to give default options
  2025-11-24  8:42 [f2fs-dev] [PATCH v2] resize.f2fs: add -g to give default options Yangyang Zang
  2025-11-24 11:26 ` Sheng Yong
@ 2025-11-25  1:26 ` Chao Yu via Linux-f2fs-devel
  1 sibling, 0 replies; 3+ messages in thread
From: Chao Yu via Linux-f2fs-devel @ 2025-11-25  1:26 UTC (permalink / raw)
  To: Yangyang Zang, jaegeuk; +Cc: Yangyang Zang, linux-f2fs-devel

On 11/24/2025 4:42 PM, Yangyang Zang wrote:
> Commit 42482e81248f ("resize.f2fs: add caution message for resize")
> introduced the `-F' option to force resizing f2fs without displaying
> the caution message. And `add_default_options()` implies that `-g'
> enables `-F' for resize by default. However resize.f2fs does not
> currently support the `-g' option. This patch adds `-g' for it.
> 
> Fixes: 42482e81248f ("resize.f2fs: add caution message for resize")
> Signed-off-by: Yangyang Zang <zangyangyang1@xiaomi.com>
> ---
> Changes in v2:
>   - Modify the commit message as suggested by shengyong
> ---
>   fsck/main.c | 11 ++++++++++-
>   1 file changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/fsck/main.c b/fsck/main.c
> index f7ef092..08d38d8 100644
> --- a/fsck/main.c
> +++ b/fsck/main.c
> @@ -145,6 +145,9 @@ void resize_usage()
>   	MSG(0, "[options]:\n");
>   	MSG(0, "  -d debug level [default:0]\n");
>   	MSG(0, "  -H support write hint\n");
> +	MSG(0, "  -f ignore errors during resize\n");
> +	MSG(0, "  -F force to resize\n");
> +	MSG(0, "  -g add default options\n");

Need to update manual page of resize.f2fs as well?

Thanks,

>   	MSG(0, "  -o overprovision percentage [default:auto]\n");
>   	MSG(0, "  -s safe resize (Does not resize metadata)\n");
>   	MSG(0, "  -t target sectors [default: device size]\n");
> @@ -640,7 +643,7 @@ void f2fs_parse_options(int argc, char *argv[])
>   #endif
>   	} else if (!strcmp("resize.f2fs", prog)) {
>   #ifdef WITH_RESIZE
> -		const char *option_string = "d:fFHst:o:V";
> +		const char *option_string = "d:fFg:Hst:o:V";
>   
>   		c.func = RESIZE;
>   		while ((option = getopt(argc, argv, option_string)) != EOF) {
> @@ -664,6 +667,12 @@ void f2fs_parse_options(int argc, char *argv[])
>   				c.force = 1;
>   				MSG(0, "Info: Force to resize\n");
>   				break;
> +                        case 'g':
> +                                if (!strcmp(optarg, "android")) {
> +                                        c.defset = CONF_ANDROID;
> +                                        MSG(0, "Info: Set conf for android\n");
> +                                }
> +                                break;
>   			case 'H':
>   				c.need_whint = true;
>   				c.whint = WRITE_LIFE_NOT_SET;



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-11-25  1:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-24  8:42 [f2fs-dev] [PATCH v2] resize.f2fs: add -g to give default options Yangyang Zang
2025-11-24 11:26 ` Sheng Yong
2025-11-25  1:26 ` Chao Yu via Linux-f2fs-devel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.