Skip to contentSkip to conversation

fstests: btrfs/057: Update test case to keep subvolume in any kernel version

PATCH In review Misono Tomohiro 2 participants 2 messages Aug 3, 2018 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 fstests: btrfs/057: Update test case to keep subvolume in any kernel version

Since commit a79a464d5675 ("btrfs: Allow rmdir(2) to delete an empty subvolume"), rm -r can delete a subvolume too.

This test assumes that rm -r does not delete a subvolume. Currently the commit does not affect the test since qgroup items still exist after subvolume deletion, but we plan to change the behavior and remove them along with subvolume deletion.

So update the test and keep subvolume (and qgroup item) in any kernel version.

---
 tests/btrfs/057 | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
tests/btrfs/057 +3 -2
index 6743f774..b019f4e1 100755
@@ -53,8 +53,9 @@ run_check $FSSTRESS_PROG -d $SCRATCH_MNT/snap1 -w -p 5 -n 1000 \
 _run_btrfs_util_prog quota enable $SCRATCH_MNT
 _run_btrfs_util_prog quota rescan -w $SCRATCH_MNT
 
-# ignore removing subvolume errors
-rm -rf $SCRATCH_MNT/* >& /dev/null
+# remove all file/dir other than subvolume
+rm -rf $SCRATCH_MNT/snap1/* >& /dev/null
+rm -rf $SCRATCH_MNT/p* >& /dev/null
 
 _run_btrfs_util_prog filesystem sync $SCRATCH_MNT
 units=`_btrfs_qgroup_units`
Signature · 1 line
2.14.4
Reviewed-by on v1 1/1
#2 lore raw
Quoted 8 lines · Misono Tomohiro

Since commit a79a464d5675 ("btrfs: Allow rmdir(2) to delete an empty subvolume"), rm -r can delete a subvolume too.

This test assumes that rm -r does not delete a subvolume. Currently the commit does not affect the test since qgroup items still exist after subvolume deletion, but we plan to change the behavior and remove them along with subvolume deletion.

Quoted 4 lines

So update the test and keep subvolume (and qgroup item) in any kernel version.