From: Eryu Guan Date: Sun, 7 Feb 2016 22:27:14 +0000 (+1100) Subject: common: add overlayfs isupport in _scratch_cleanup_files() X-Git-Tag: v2022.05.01~2668 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=22bc781c391baa0153d16ffbd7d6c9990b5d401f;p=users%2Fhch%2Fxfstests-dev.git 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 Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner --- diff --git a/common/rc b/common/rc index 0c4ef666c..e4a163d72 100644 --- 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()