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

Message ID 4b4e3480-ccb7-d0aa-2a37-ea51699728e8@jp.fujitsu.com
State New
Headers show
Series
  • fstests: btrfs/057: Update test case to keep subvolume in any kernel version
Related show

Commit Message

Misono Tomohiro Aug. 3, 2018, 6:44 a.m. UTC
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.

Signed-off-by: Misono Tomohiro <misono.tomohiro@jp.fujitsu.com>
---
 tests/btrfs/057 | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

David Sterba Aug. 3, 2018, 1:39 p.m. UTC | #1
On Fri, Aug 03, 2018 at 03:44:37PM +0900, Misono Tomohiro wrote:
> 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.
> 
> Signed-off-by: Misono Tomohiro <misono.tomohiro@jp.fujitsu.com>

Reviewed-by: David Sterba <dsterba@suse.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch
diff mbox series

diff --git a/tests/btrfs/057 b/tests/btrfs/057
index 6743f774..b019f4e1 100755
--- a/tests/btrfs/057
+++ b/tests/btrfs/057
@@ -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`