Skip to contentSkip to conversation

fstests: common/btrfs: use complete sub command

PATCH Superseded Anand Jain 3 participants 4 messages Feb 10, 2020 – Feb 11, 2020 Btrfs file system

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Anand Jain

author
#0 lore raw

PATCH 1/1 fstests: common/btrfs: use complete sub command

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.

---
 common/btrfs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/btrfs +1 -1
index 19ac7cc4b18c..33ad7e3b41cc 100644
@@ -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>]
Signature · 1 line
1.8.3.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Anand Jain

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.

Quoted 2 lines
Quoted 19 lines
---
 common/btrfs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/btrfs +1 -1
index 19ac7cc4b18c..33ad7e3b41cc 100644
@@ -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>]

author
#2 lore raw
Quoted 7 lines · Marcos Paulo de Souza
Quoted 4 lines · Anand Jain

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.

#3 lore raw
In reply to Anand Jain
Quoted 6 lines · Anand Jain

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.

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.

Quoted 18 lines
---
 common/btrfs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/btrfs +1 -1
index 19ac7cc4b18c..33ad7e3b41cc 100644
@@ -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>]