public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
From: Amir Goldstein <amir73il@gmail.com>
To: Eryu Guan <eguan@redhat.com>
Cc: zhangyi <yi.zhang@huawei.com>, Miklos Szeredi <miklos@szeredi.hu>,
	linux-unionfs@vger.kernel.org, fstests@vger.kernel.org
Subject: [PATCH 3/4] overlay: consider index dir with whiteouts clean
Date: Fri, 26 Jan 2018 09:59:07 +0200	[thread overview]
Message-ID: <1516953548-15679-4-git-send-email-amir73il@gmail.com> (raw)
In-Reply-To: <1516953548-15679-1-git-send-email-amir73il@gmail.com>

Several tests check that index dir is empty after upper entries have
been unlinked. With nfs_export=on, index will contain a whiteout index
entry in that case so, allow chardevs when checking for clean index dir.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
---
 tests/overlay/033 | 8 ++++++--
 tests/overlay/034 | 8 ++++++--
 tests/overlay/048 | 4 +++-
 3 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/tests/overlay/033 b/tests/overlay/033
index 30780c6..3e67500 100755
--- a/tests/overlay/033
+++ b/tests/overlay/033
@@ -69,7 +69,6 @@ report_nlink()
 # Create lower hardlinks
 create_hardlinks()
 {
-	lowerdir=$OVL_BASE_SCRATCH_MNT/$OVL_LOWER
 	mkdir -p $lowerdir
 	touch $lowerdir/0
 	ln $lowerdir/0 $lowerdir/1
@@ -123,9 +122,14 @@ test_hardlinks()
 	rm $SCRATCH_MNT/2
 
 	# Verify that orphan index is cleaned when dropping nlink to zero
-	ls $OVL_BASE_SCRATCH_MNT/$OVL_WORK/index
+	# With nfs_export=on index will contain a whiteout index entry, so allow
+	# chardev entries in index dir.
+	find $workdir/index -mindepth 1 -type c -o -print
 }
 
+lowerdir=$OVL_BASE_SCRATCH_MNT/$OVL_LOWER
+workdir=$OVL_BASE_SCRATCH_MNT/$OVL_WORK
+
 # Remove all files from previous tests
 _scratch_mkfs
 
diff --git a/tests/overlay/034 b/tests/overlay/034
index dc354c6..d9f9798 100755
--- a/tests/overlay/034
+++ b/tests/overlay/034
@@ -67,11 +67,13 @@ _require_scratch
 # Without overlay index feature hardlinks are broken on copy up
 _require_scratch_feature index
 
+lowerdir=$OVL_BASE_SCRATCH_MNT/$OVL_LOWER
+workdir=$OVL_BASE_SCRATCH_MNT/$OVL_WORK
+
 # Remove all files from previous tests
 _scratch_mkfs
 
 # Create lower hardlink
-lowerdir=$OVL_BASE_SCRATCH_MNT/$OVL_LOWER
 mkdir -p $lowerdir
 touch $lowerdir/0
 ln $lowerdir/0 $lowerdir/1
@@ -103,7 +105,9 @@ rm $SCRATCH_MNT/4
 
 # Verify that orphan index is cleaned on mount
 _scratch_cycle_mount index=on
-ls $OVL_BASE_SCRATCH_MNT/$OVL_WORK/index
+# With nfs_export=on index will contain a whiteout index entry, so allow
+# chardev entries in index dir.
+find $workdir/index -mindepth 1 -type c -o -print
 
 echo "Silence is golden"
 status=0
diff --git a/tests/overlay/048 b/tests/overlay/048
index 4b2c58f..3ce6270 100755
--- a/tests/overlay/048
+++ b/tests/overlay/048
@@ -111,7 +111,9 @@ test_hardlinks_offline()
 	report_nlink "unlink last lower"
 
 	# Verify that orphan index is cleaned when dropping nlink to zero
-	ls $workdir/index
+	# With nfs_export=on index will contain a whiteout index entry, so allow
+	# chardev entries in index dir.
+	find $workdir/index -mindepth 1 -type c -o -print
 }
 
 lowerdir=$OVL_BASE_SCRATCH_MNT/$OVL_LOWER
-- 
2.7.4


  parent reply	other threads:[~2018-01-26  7:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-26  7:59 [PATCH 0/4] Assorted overlay test fixes Amir Goldstein
2018-01-26  7:59 ` [PATCH 1/4] ovelray: drop explicit use of OVERLAY_MOUNT_OPTIONS Amir Goldstein
2018-01-26  7:59 ` [PATCH 2/4] overlay/036: fix upper/lower dir mismatch Amir Goldstein
2018-01-26  7:59 ` Amir Goldstein [this message]
2018-01-26  7:59 ` [PATCH 4/4] overlay/017: require and enable redirect_dir Amir Goldstein
2018-01-29  8:10   ` Eryu Guan
2018-01-29  9:25     ` Amir Goldstein

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1516953548-15679-4-git-send-email-amir73il@gmail.com \
    --to=amir73il@gmail.com \
    --cc=eguan@redhat.com \
    --cc=fstests@vger.kernel.org \
    --cc=linux-unionfs@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=yi.zhang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox