xfs
[Top] [All Lists]

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

To: <xfs@xxxxxxxxxxx>, <linux-btrfs@xxxxxxxxxxxxxxx>
Subject: [PATCH] xfstests: fix set-default test in btrfs/001
From: Josef Bacik <jbacik@xxxxxxxxxxxx>
Date: Wed, 18 Sep 2013 16:48:27 -0400
Delivered-to: xfs@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fusionio.com; s=default; t=1379537319; bh=pLsXSTBok/Fn29mfS6A6VdEuFIKr8IdRJa7RncTqV+Q=; h=From:To:Subject:Date; b=awTMR/bWqy3oq9n20J5OYX+35SdutpkpKTqdVkW8rttV5iSPL6sjoiSGageI1BjEq jlqHZW3guaGzk1gu8Ze9iPl0+TY8522AzzldfuPNEPDiStOqnEyz+LbpXXD7W+1XT1 ytlg797TF634pdfJrl2G6hb6BpLYPmwjuMtvo3/w=
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,

Signed-off-by: Josef Bacik <jbacik@xxxxxxxxxxxx>
---
 tests/btrfs/001 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/btrfs/001 b/tests/btrfs/001
index 9aa2431..c05d772 100755
--- a/tests/btrfs/001
+++ b/tests/btrfs/001
@@ -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
-- 
1.8.3.1

<Prev in Thread] Current Thread [Next in Thread>