FSTests Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] fstests: common/btrfs: use complete sub command
@ 2020-02-10  3:13 Anand Jain
  2020-02-10 12:03 ` Marcos Paulo de Souza
  2020-02-10 15:52 ` Nikolay Borisov
  0 siblings, 2 replies; 4+ messages in thread
From: Anand Jain @ 2020-02-10  3:13 UTC (permalink / raw)
  To: fstests; +Cc: linux-btrfs

Grep failed to find this subcommand of btrfs, leading to a wrong
inference for a moment.

Make sure we use the full subcommand name in the btrfs command.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
 common/btrfs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/btrfs b/common/btrfs
index 19ac7cc4b18c..33ad7e3b41cc 100644
--- a/common/btrfs
+++ b/common/btrfs
@@ -7,7 +7,7 @@ _btrfs_get_subvolid()
 	mnt=$1
 	name=$2
 
-	$BTRFS_UTIL_PROG sub list $mnt | grep $name | awk '{ print $2 }'
+	$BTRFS_UTIL_PROG subvolume list $mnt | grep $name | awk '{ print $2 }'
 }
 
 # _require_btrfs_command <command> [<subcommand>|<option>]
-- 
1.8.3.1


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

* Re: [PATCH] fstests: common/btrfs: use complete sub command
  2020-02-10  3:13 [PATCH] fstests: common/btrfs: use complete sub command Anand Jain
@ 2020-02-10 12:03 ` Marcos Paulo de Souza
  2020-02-11  0:45   ` Anand Jain
  2020-02-10 15:52 ` Nikolay Borisov
  1 sibling, 1 reply; 4+ messages in thread
From: Marcos Paulo de Souza @ 2020-02-10 12:03 UTC (permalink / raw)
  To: Anand Jain, fstests; +Cc: linux-btrfs

On Mon, 2020-02-10 at 11:13 +0800, Anand Jain wrote:
> Grep failed to find this subcommand of btrfs, leading to a wrong
> inference for a moment.
> 
> Make sure we use the full subcommand name in the btrfs command.

Well, I don't see how this could fail, but IMHO I like to see these
commands written in full rather than using contracted names.

> 
> Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: Marcos Paulo de Souza <mpdesouza@suse.com>


> ---
>  common/btrfs | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/common/btrfs b/common/btrfs
> index 19ac7cc4b18c..33ad7e3b41cc 100644
> --- a/common/btrfs
> +++ b/common/btrfs
> @@ -7,7 +7,7 @@ _btrfs_get_subvolid()
>  	mnt=$1
>  	name=$2
>  
> -	$BTRFS_UTIL_PROG sub list $mnt | grep $name | awk '{ print $2
> }'
> +	$BTRFS_UTIL_PROG subvolume list $mnt | grep $name | awk '{
> print $2 }'
>  }
>  
>  # _require_btrfs_command <command> [<subcommand>|<option>]


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

* Re: [PATCH] fstests: common/btrfs: use complete sub command
  2020-02-10  3:13 [PATCH] fstests: common/btrfs: use complete sub command Anand Jain
  2020-02-10 12:03 ` Marcos Paulo de Souza
@ 2020-02-10 15:52 ` Nikolay Borisov
  1 sibling, 0 replies; 4+ messages in thread
From: Nikolay Borisov @ 2020-02-10 15:52 UTC (permalink / raw)
  To: Anand Jain, fstests; +Cc: linux-btrfs



On 10.02.20 г. 5:13 ч., Anand Jain wrote:
> Grep failed to find this subcommand of btrfs, leading to a wrong
> inference for a moment.
> 
> Make sure we use the full subcommand name in the btrfs command.
> 
> Signed-off-by: Anand Jain <anand.jain@oracle.com>

NAK.

It's not entirely clearly what this patch fixes, since grep doesn't
interact with the subcomand at all, it interacts with its result.
Furthermore command expansion is performed by btrfs-completion script so
fixes about command expansion should go there.
> ---
>  common/btrfs | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/common/btrfs b/common/btrfs
> index 19ac7cc4b18c..33ad7e3b41cc 100644
> --- a/common/btrfs
> +++ b/common/btrfs
> @@ -7,7 +7,7 @@ _btrfs_get_subvolid()
>  	mnt=$1
>  	name=$2
>  
> -	$BTRFS_UTIL_PROG sub list $mnt | grep $name | awk '{ print $2 }'
> +	$BTRFS_UTIL_PROG subvolume list $mnt | grep $name | awk '{ print $2 }'
>  }
>  
>  # _require_btrfs_command <command> [<subcommand>|<option>]
> 

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

* Re: [PATCH] fstests: common/btrfs: use complete sub command
  2020-02-10 12:03 ` Marcos Paulo de Souza
@ 2020-02-11  0:45   ` Anand Jain
  0 siblings, 0 replies; 4+ messages in thread
From: Anand Jain @ 2020-02-11  0:45 UTC (permalink / raw)
  To: Marcos Paulo de Souza, fstests; +Cc: linux-btrfs

On 2/10/20 8:03 PM, Marcos Paulo de Souza wrote:
> On Mon, 2020-02-10 at 11:13 +0800, Anand Jain wrote:
>> Grep failed to find this subcommand of btrfs, leading to a wrong
>> inference for a moment.
>>
>> Make sure we use the full subcommand name in the btrfs command.
> 
> Well, I don't see how this could fail,

Its about searching for the subvolume sub-command in the file common/btrfs.

I hope this clarifies. Change log is updated in v2.

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

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-10  3:13 [PATCH] fstests: common/btrfs: use complete sub command Anand Jain
2020-02-10 12:03 ` Marcos Paulo de Souza
2020-02-11  0:45   ` Anand Jain
2020-02-10 15:52 ` Nikolay Borisov

FSTests Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/fstests/0 fstests/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 fstests fstests/ https://lore.kernel.org/fstests \
		fstests@vger.kernel.org
	public-inbox-index fstests

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.fstests


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git