Skip to contentSkip to conversation

fstests: common/btrfs: use complete sub command

PATCH In review Anand Jain 2 participants 2 messages Feb 11, 2020 Btrfs file system

lore
Share & tools
lore

Anand Jain

author
#0 lore raw

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

Search for 'subvolume' in the file common/btrfs failed to find all of them, leading to a wrong inference for a moment.

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

Marcos Paulo de Souza <[email protected]>
---
v2: Update commit log.

 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
#1 lore raw
Quoted 4 lines · Anand Jain

Search for 'subvolume' in the file common/btrfs failed to find all of them, leading to a wrong inference for a moment.

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

Hum, in my tests realted to subvol delete by id[1], this function successfully got the subvolid for subvol names like subvol[123].. Do you have a case where it fails?

Quoted 3 lines

Marcos Paulo de Souza <[email protected]>

Here you meant I reviewed the first version of the patch?

Thanks,
Marcos

[1]:
https://lore.kernel.org/linux-btrfs/[email protected]/

Quoted 21 lines

---
v2: Update commit log.

 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>]