common: add overlayfs isupport in _scratch_cleanup_files()

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>
This commit is contained in:
Eryu Guan
2016-02-08 09:27:14 +11:00
committed by Dave Chinner
parent c327d5a637
commit 22bc781c39
+11 -3
View File
@@ -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()