public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/3] common: remove all files in $SCRATCH_DEV for overlayfs in _scratch_cleanup_files()
@ 2016-01-12  8:30 Eryu Guan
  2016-01-12  8:30 ` [PATCH v2 2/3] common: export overlay lower/upper/work directories as variables Eryu Guan
  2016-01-12  8:30 ` [PATCH v2 3/3] overlay: test copy up files from lower dir Eryu Guan
  0 siblings, 2 replies; 3+ messages in thread
From: Eryu Guan @ 2016-01-12  8:30 UTC (permalink / raw)
  To: fstests; +Cc: linux-unionfs, Eryu Guan

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>
---

No update in v2.

 common/rc | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/common/rc b/common/rc
index 5135260..75d1582 100644
--- a/common/rc
+++ b/common/rc
@@ -701,9 +701,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()
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-01-12  8:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-12  8:30 [PATCH v2 1/3] common: remove all files in $SCRATCH_DEV for overlayfs in _scratch_cleanup_files() Eryu Guan
2016-01-12  8:30 ` [PATCH v2 2/3] common: export overlay lower/upper/work directories as variables Eryu Guan
2016-01-12  8:30 ` [PATCH v2 3/3] overlay: test copy up files from lower dir Eryu Guan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox