]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
common: add overlayfs isupport in _scratch_cleanup_files()
authorEryu Guan <eguan@redhat.com>
Sun, 7 Feb 2016 22:27:14 +0000 (09:27 +1100)
committerDave Chinner <david@fromorbit.com>
Sun, 7 Feb 2016 22:27:14 +0000 (09:27 +1100)
All files in lower/upper dirs should be removed for overlayfs in
_scratch_cleanup_files(), not only files in merged dir, otherwise files
from lower dir won't be removed.

Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
common/rc

index 0c4ef666ca2a89c37857f8283f80d7f527a88bc4..e4a163d726b02984a46ee88276b5c8f4a851583e 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -707,9 +707,17 @@ _mkfs_dev()
 # remove all files in $SCRATCH_MNT, useful when testing on NFS/CIFS
 _scratch_cleanup_files()
 {
-       _scratch_mount
-       rm -rf $SCRATCH_MNT/*
-       _scratch_unmount
+       case $FSTYP in
+       overlay)
+               # $SCRATCH_DEV is a valid directory in overlay case
+               rm -rf $SCRATCH_DEV/*
+               ;;
+       *)
+               _scratch_mount
+               rm -rf $SCRATCH_MNT/*
+               _scratch_unmount
+               ;;
+       esac
 }
 
 _scratch_mkfs()