All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mkfs.f2fs: show the info of volume label only when specify it
@ 2018-10-08 12:39 Tiezhu Yang
  2018-10-15 12:08 ` Chao Yu
  0 siblings, 1 reply; 2+ messages in thread
From: Tiezhu Yang @ 2018-10-08 12:39 UTC (permalink / raw)
  To: jaegeuk, yuchao0; +Cc: linux-f2fs-devel

Currently, when format disk used with mkfs.f2fs, even if the volume label
is not specified, it still shows the info of volume label with no content
due to the check condition is always true, this patch fixes it.

[root@localhost home]# mkfs.f2fs -f /dev/sdb1

	F2FS-tools: mkfs.f2fs Ver: 1.12.0 (2018-10-08)

Info: Disable heap-based policy
Info: Debug level = 0
Info: Label = 
Info: Trim is enabled

Signed-off-by: Tiezhu Yang <kernelpatch@126.com>
---
 mkfs/f2fs_format_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mkfs/f2fs_format_main.c b/mkfs/f2fs_format_main.c
index 1424cc3..6ea8068 100644
--- a/mkfs/f2fs_format_main.c
+++ b/mkfs/f2fs_format_main.c
@@ -81,7 +81,7 @@ static void f2fs_show_info()
 	if (c.extension_list[1])
 		MSG(0, "Info: Add new hot file extension list\n");
 
-	if (c.vol_label)
+	if (strlen(c.vol_label))
 		MSG(0, "Info: Label = %s\n", c.vol_label);
 	MSG(0, "Info: Trim is %s\n", c.trim ? "enabled": "disabled");
 
-- 
1.8.3.1

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

* Re: [PATCH] mkfs.f2fs: show the info of volume label only when specify it
  2018-10-08 12:39 [PATCH] mkfs.f2fs: show the info of volume label only when specify it Tiezhu Yang
@ 2018-10-15 12:08 ` Chao Yu
  0 siblings, 0 replies; 2+ messages in thread
From: Chao Yu @ 2018-10-15 12:08 UTC (permalink / raw)
  To: Tiezhu Yang, jaegeuk; +Cc: linux-f2fs-devel

On 2018/10/8 20:39, Tiezhu Yang wrote:
> Currently, when format disk used with mkfs.f2fs, even if the volume label
> is not specified, it still shows the info of volume label with no content
> due to the check condition is always true, this patch fixes it.
> 
> [root@localhost home]# mkfs.f2fs -f /dev/sdb1
> 
> 	F2FS-tools: mkfs.f2fs Ver: 1.12.0 (2018-10-08)
> 
> Info: Disable heap-based policy
> Info: Debug level = 0
> Info: Label = 
> Info: Trim is enabled

Like tune2fs does, we can show volume label as below if user didn't set it.

Info: Label = <none>

Thanks,

> 
> Signed-off-by: Tiezhu Yang <kernelpatch@126.com>
> ---
>  mkfs/f2fs_format_main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mkfs/f2fs_format_main.c b/mkfs/f2fs_format_main.c
> index 1424cc3..6ea8068 100644
> --- a/mkfs/f2fs_format_main.c
> +++ b/mkfs/f2fs_format_main.c
> @@ -81,7 +81,7 @@ static void f2fs_show_info()
>  	if (c.extension_list[1])
>  		MSG(0, "Info: Add new hot file extension list\n");
>  
> -	if (c.vol_label)
> +	if (strlen(c.vol_label))
>  		MSG(0, "Info: Label = %s\n", c.vol_label);
>  	MSG(0, "Info: Trim is %s\n", c.trim ? "enabled": "disabled");
>  
> 

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

end of thread, other threads:[~2018-10-15 12:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-08 12:39 [PATCH] mkfs.f2fs: show the info of volume label only when specify it Tiezhu Yang
2018-10-15 12:08 ` Chao Yu

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.