linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [PATCH] common/config: support f2fs-tools v1.9 and later
@ 2018-04-05 22:19 Eric Biggers via Linux-f2fs-devel
  2018-04-07 15:29 ` Eryu Guan
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Biggers via Linux-f2fs-devel @ 2018-04-05 22:19 UTC (permalink / raw)
  To: fstests; +Cc: Eric Biggers, linux-f2fs-devel

Pass the -f option to mkfs.f2fs when it appears to support it.  This is
required by f2fs-tools v1.9 and later in order to format the filesystem
even when an existing filesystem is detected.  But earlier versions did
not accept this option.

Signed-off-by: Eric Biggers <ebiggers@google.com>
---
 common/config | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/common/config b/common/config
index 20f0e5f3..7c046a78 100644
--- a/common/config
+++ b/common/config
@@ -94,10 +94,11 @@ set_prog_path()
 	type -P $1
 }
 
-# Handle mkfs.btrfs which does (or does not) require -f to overwrite
-set_btrfs_mkfs_prog_path_with_opts()
+# Handle mkfs.$fstyp which does (or does not) require -f to overwrite
+set_mkfs_prog_path_with_opts()
 {
-	p=`set_prog_path mkfs.btrfs`
+	local fstyp=$1
+	local p=`set_prog_path mkfs.$fstyp`
 	if [ "$p" != "" ] && grep -q 'force overwrite' $p; then
 		echo "$p -f"
 	else
@@ -223,8 +224,8 @@ case "$HOSTOS" in
         export MKFS_XFS_PROG="`set_prog_path mkfs.xfs`"
         export MKFS_EXT4_PROG="`set_prog_path mkfs.ext4`"
         export MKFS_UDF_PROG="`set_prog_path mkudffs`"
-        export MKFS_BTRFS_PROG="`set_btrfs_mkfs_prog_path_with_opts`"
-        export MKFS_F2FS_PROG="`set_prog_path mkfs.f2fs`"
+        export MKFS_BTRFS_PROG="`set_mkfs_prog_path_with_opts btrfs`"
+        export MKFS_F2FS_PROG="`set_mkfs_prog_path_with_opts f2fs`"
         export DUMP_F2FS_PROG="`set_prog_path dump.f2fs`"
         export BTRFS_UTIL_PROG="`set_prog_path btrfs`"
         export BTRFS_SHOW_SUPER_PROG="`set_prog_path btrfs-show-super`"
-- 
2.17.0.484.g0c8726318c-goog


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

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

* Re: [PATCH] common/config: support f2fs-tools v1.9 and later
  2018-04-05 22:19 [PATCH] common/config: support f2fs-tools v1.9 and later Eric Biggers via Linux-f2fs-devel
@ 2018-04-07 15:29 ` Eryu Guan
  2018-04-09  2:33   ` Chao Yu
  0 siblings, 1 reply; 3+ messages in thread
From: Eryu Guan @ 2018-04-07 15:29 UTC (permalink / raw)
  To: Eric Biggers; +Cc: fstests, linux-f2fs-devel

On Thu, Apr 05, 2018 at 03:19:01PM -0700, Eric Biggers wrote:
> Pass the -f option to mkfs.f2fs when it appears to support it.  This is
> required by f2fs-tools v1.9 and later in order to format the filesystem
> even when an existing filesystem is detected.  But earlier versions did
> not accept this option.
> 
> Signed-off-by: Eric Biggers <ebiggers@google.com>

Looks fine to me, but I'd like an ACK from f2fs developers.

> ---
>  common/config | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/common/config b/common/config
> index 20f0e5f3..7c046a78 100644
> --- a/common/config
> +++ b/common/config
> @@ -94,10 +94,11 @@ set_prog_path()
>  	type -P $1
>  }
>  
> -# Handle mkfs.btrfs which does (or does not) require -f to overwrite
> -set_btrfs_mkfs_prog_path_with_opts()
> +# Handle mkfs.$fstyp which does (or does not) require -f to overwrite
> +set_mkfs_prog_path_with_opts()
>  {
> -	p=`set_prog_path mkfs.btrfs`
> +	local fstyp=$1
> +	local p=`set_prog_path mkfs.$fstyp`
>  	if [ "$p" != "" ] && grep -q 'force overwrite' $p; then

Also grep the "$p -h" output instead of the binary file?

Thanks,
Eryu

>  		echo "$p -f"
>  	else
> @@ -223,8 +224,8 @@ case "$HOSTOS" in
>          export MKFS_XFS_PROG="`set_prog_path mkfs.xfs`"
>          export MKFS_EXT4_PROG="`set_prog_path mkfs.ext4`"
>          export MKFS_UDF_PROG="`set_prog_path mkudffs`"
> -        export MKFS_BTRFS_PROG="`set_btrfs_mkfs_prog_path_with_opts`"
> -        export MKFS_F2FS_PROG="`set_prog_path mkfs.f2fs`"
> +        export MKFS_BTRFS_PROG="`set_mkfs_prog_path_with_opts btrfs`"
> +        export MKFS_F2FS_PROG="`set_mkfs_prog_path_with_opts f2fs`"
>          export DUMP_F2FS_PROG="`set_prog_path dump.f2fs`"
>          export BTRFS_UTIL_PROG="`set_prog_path btrfs`"
>          export BTRFS_SHOW_SUPER_PROG="`set_prog_path btrfs-show-super`"
> -- 
> 2.17.0.484.g0c8726318c-goog
> 
> --
> To unsubscribe from this list: send the line "unsubscribe fstests" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

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

* Re: [PATCH] common/config: support f2fs-tools v1.9 and later
  2018-04-07 15:29 ` Eryu Guan
@ 2018-04-09  2:33   ` Chao Yu
  0 siblings, 0 replies; 3+ messages in thread
From: Chao Yu @ 2018-04-09  2:33 UTC (permalink / raw)
  To: Eryu Guan, Eric Biggers; +Cc: fstests, linux-f2fs-devel

On 2018/4/7 23:29, Eryu Guan wrote:
> On Thu, Apr 05, 2018 at 03:19:01PM -0700, Eric Biggers wrote:
>> Pass the -f option to mkfs.f2fs when it appears to support it.  This is
>> required by f2fs-tools v1.9 and later in order to format the filesystem
>> even when an existing filesystem is detected.  But earlier versions did
>> not accept this option.
>>
>> Signed-off-by: Eric Biggers <ebiggers@google.com>
> 
> Looks fine to me, but I'd like an ACK from f2fs developers.

Acked-by: Chao Yu <yuchao0@huawei.com>

Thanks,

> 
>> ---
>>  common/config | 11 ++++++-----
>>  1 file changed, 6 insertions(+), 5 deletions(-)
>>
>> diff --git a/common/config b/common/config
>> index 20f0e5f3..7c046a78 100644
>> --- a/common/config
>> +++ b/common/config
>> @@ -94,10 +94,11 @@ set_prog_path()
>>  	type -P $1
>>  }
>>  
>> -# Handle mkfs.btrfs which does (or does not) require -f to overwrite
>> -set_btrfs_mkfs_prog_path_with_opts()
>> +# Handle mkfs.$fstyp which does (or does not) require -f to overwrite
>> +set_mkfs_prog_path_with_opts()
>>  {
>> -	p=`set_prog_path mkfs.btrfs`
>> +	local fstyp=$1
>> +	local p=`set_prog_path mkfs.$fstyp`
>>  	if [ "$p" != "" ] && grep -q 'force overwrite' $p; then
> 
> Also grep the "$p -h" output instead of the binary file?
> 
> Thanks,
> Eryu
> 
>>  		echo "$p -f"
>>  	else
>> @@ -223,8 +224,8 @@ case "$HOSTOS" in
>>          export MKFS_XFS_PROG="`set_prog_path mkfs.xfs`"
>>          export MKFS_EXT4_PROG="`set_prog_path mkfs.ext4`"
>>          export MKFS_UDF_PROG="`set_prog_path mkudffs`"
>> -        export MKFS_BTRFS_PROG="`set_btrfs_mkfs_prog_path_with_opts`"
>> -        export MKFS_F2FS_PROG="`set_prog_path mkfs.f2fs`"
>> +        export MKFS_BTRFS_PROG="`set_mkfs_prog_path_with_opts btrfs`"
>> +        export MKFS_F2FS_PROG="`set_mkfs_prog_path_with_opts f2fs`"
>>          export DUMP_F2FS_PROG="`set_prog_path dump.f2fs`"
>>          export BTRFS_UTIL_PROG="`set_prog_path btrfs`"
>>          export BTRFS_SHOW_SUPER_PROG="`set_prog_path btrfs-show-super`"
>> -- 
>> 2.17.0.484.g0c8726318c-goog
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe fstests" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> --
> To unsubscribe from this list: send the line "unsubscribe fstests" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

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

end of thread, other threads:[~2018-04-09  2:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-05 22:19 [PATCH] common/config: support f2fs-tools v1.9 and later Eric Biggers via Linux-f2fs-devel
2018-04-07 15:29 ` Eryu Guan
2018-04-09  2:33   ` Chao Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).