Skip to contentSkip to conversation

xfstests: fix set-default test in btrfs/001

PATCH In review Josef Bacik 3 participants 4 messages Sep 18, 2013 – Oct 16, 2013 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfstests: fix set-default test in btrfs/001

We were actually testing this improperly, there was a bug in the set default code so we weren't actually honoring the 0 subvolid properly. To fix this we need to get the subvolid for the subvol we want to set as the default and use that in the command. With this patch we now pass again with the fix for the 0 subvolid. Thanks,

---
 tests/btrfs/001 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tests/btrfs/001 +2 -1
index 9aa2431..c05d772 100755
@@ -77,7 +77,8 @@ ls $SCRATCH_MNT/subvol
 echo "Creating file bar in subvol"
 dd if=/dev/zero of=$SCRATCH_MNT/subvol/bar bs=1M count=1 &> /dev/null
 echo "Setting subvol to the default"
-$BTRFS_UTIL_PROG subvolume set-default 0 $SCRATCH_MNT/subvol | _filter_scratch
+subvolid=$(_btrfs_get_subvolid $SCRATCH_MNT subvol)
+$BTRFS_UTIL_PROG subvolume set-default $subvolid $SCRATCH_MNT | _filter_scratch
 _scratch_remount
 echo "List root dir which is now subvol"
 ls $SCRATCH_MNT
Signature · 1 line
1.8.3.1
Tested-by on v1 1/1
#1 lore raw
Quoted 7 lines · Josef Bacik

We were actually testing this improperly, there was a bug in the set default code so we weren't actually honoring the 0 subvolid properly. To fix this we need to get the subvolid for the subvol we want to set as the default and use that in the command. With this patch we now pass again with the fix for the 0 subvolid. Thanks,