public inbox for linux-unionfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Amir Goldstein <amir73il@gmail.com>
To: Eryu Guan <eguan@redhat.com>
Cc: Miklos Szeredi <miklos@szeredi.hu>,
	linux-unionfs@vger.kernel.org, fstests@vger.kernel.org
Subject: [PATCH 3/6] overlay/018: test broken hardlinks after mount cycle
Date: Tue,  4 Jul 2017 14:20:31 +0300	[thread overview]
Message-ID: <1499167234-22779-4-git-send-email-amir73il@gmail.com> (raw)
In-Reply-To: <1499167234-22779-1-git-send-email-amir73il@gmail.com>

This test checks if overlayfs hardlinks are preserved across
copy up.  Check if they are preserved also after copy up and
mount cycle.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
---
 tests/overlay/018     | 13 +++++++++++--
 tests/overlay/018.out |  5 +++++
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/tests/overlay/018 b/tests/overlay/018
index 7570a16..46097a9 100755
--- a/tests/overlay/018
+++ b/tests/overlay/018
@@ -96,11 +96,20 @@ cat $FILES
 record_ino_nlink $tmp.before
 
 # Modify content of one of the hardlinks
-echo "one" >> $foo
+# Intentionally modify the last hardlink in $FILES, so after mount cycle
+# when reading the first file in $FILES, last file won't be in inode/dcache
+echo "one" >> $bar
 
 echo "== After write one =="
 cat $FILES
-check_ino_nlink $tmp.before $tmp.after
+check_ino_nlink $tmp.before $tmp.after_one
+
+# Verify that the hardlinks survive a mount cycle
+_scratch_cycle_mount
+
+echo "== After mount cycle =="
+cat $FILES
+check_ino_nlink $tmp.after_one $tmp.after_cycle
 
 status=0
 exit
diff --git a/tests/overlay/018.out b/tests/overlay/018.out
index 784e8bc..5b74ee1 100644
--- a/tests/overlay/018.out
+++ b/tests/overlay/018.out
@@ -7,3 +7,8 @@ zero
 one
 zero
 one
+== After mount cycle ==
+zero
+one
+zero
+one
-- 
2.7.4

  parent reply	other threads:[~2017-07-04 11:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-04 11:20 [PATCH 0/6] overlay hardlink tests Amir Goldstein
2017-07-04 11:20 ` [PATCH 1/6] overlay/018: re-factor and add to hardlink group Amir Goldstein
2017-07-04 11:20 ` [PATCH 2/6] overlay/018: print hardlink content to golden output Amir Goldstein
2017-07-04 11:20 ` Amir Goldstein [this message]
2017-07-04 11:20 ` [PATCH 4/6] overlay/018: test lower hardlinks re-unite on copy up Amir Goldstein
2017-07-04 11:20 ` [PATCH 5/6] overlay: test concurrent copy up of lower hardlinks Amir Goldstein
2017-07-04 11:20 ` [PATCH 6/6] overlay: test dropping nlink below zero 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=1499167234-22779-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 \
    /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