From 22bc781c391baa0153d16ffbd7d6c9990b5d401f Mon Sep 17 00:00:00 2001 From: Eryu Guan Date: Mon, 8 Feb 2016 09:27:14 +1100 Subject: [PATCH] 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 --- common/rc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/common/rc b/common/rc index 0c4ef666..e4a163d7 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() -- 2.39.5