linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Amir Goldstein <amir73il@gmail.com>
To: Eryu Guan <eguan@redhat.com>
Cc: Jeff Layton <jlayton@poochiereds.net>,
	"J . Bruce Fields" <bfields@fieldses.org>,
	Miklos Szeredi <miklos@szeredi.hu>,
	fstests@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-unionfs@vger.kernel.org
Subject: [PATCH 5/7] generic/exportfs: add a test case for renamed parent dir
Date: Sun,  7 Jan 2018 20:07:23 +0200	[thread overview]
Message-ID: <1515348445-1403-6-git-send-email-amir73il@gmail.com> (raw)
In-Reply-To: <1515348445-1403-1-git-send-email-amir73il@gmail.com>

Check that a dir file handle can be opened after its parent
has been renamed.

Retry decoding subdir file handle when parent is in dcache
and when parent is not in dcache.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
---
 tests/generic/467     | 7 +++++++
 tests/generic/467.out | 3 +++
 2 files changed, 10 insertions(+)

diff --git a/tests/generic/467 b/tests/generic/467
index 592ffbe..555b44b 100755
--- a/tests/generic/467
+++ b/tests/generic/467
@@ -67,6 +67,7 @@ create_test_files()
 	local opt=$2
 
 	rm -rf $dir
+	mkdir -p $dir
 	$here/src/open_by_handle -cwp $dir $NUMFILES
 }
 
@@ -114,12 +115,18 @@ test_file_handles $TEST_DIR -r -i $tmp.file_handles
 
 # Check non-stale file handles of renamed dirs
 create_test_files $testdir
+create_test_files $testdir/subdir
 rm -rf $testdir.renamed
 # Store file handles before rename of testdir
 test_file_handles $testdir -p -o $tmp.file_handles
+test_file_handles $testdir/subdir -p -o $tmp.subdir_file_handles
 mv $testdir $testdir.renamed/
 # Check open, read and readdir from stored file handles
 test_file_handles $TEST_DIR -rp -i $tmp.file_handles
+test_file_handles $TEST_DIR -rp -i $tmp.subdir_file_handles
+# Retry decoding subdir file handle when testdir is in dcache
+# (providing renamed testdir argument pins testdir to dcache)
+test_file_handles $testdir.renamed -rp -i $tmp.subdir_file_handles
 
 status=0
 exit
diff --git a/tests/generic/467.out b/tests/generic/467.out
index c29289e..dfa3240 100644
--- a/tests/generic/467.out
+++ b/tests/generic/467.out
@@ -8,4 +8,7 @@ test_file_handles TEST_DIR/467-dir -mr
 test_file_handles TEST_DIR/467-dir -o file_handles
 test_file_handles TEST_DIR -r -i file_handles
 test_file_handles TEST_DIR/467-dir -p -o file_handles
+test_file_handles TEST_DIR/467-dir/subdir -p -o subdir_file_handles
 test_file_handles TEST_DIR -rp -i file_handles
+test_file_handles TEST_DIR -rp -i subdir_file_handles
+test_file_handles TEST_DIR/467-dir.renamed -rp -i subdir_file_handles
-- 
2.7.4

  parent reply	other threads:[~2018-01-07 18:06 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-07 18:07 [PATCH 0/7] Overlayfs exportfs tests Amir Goldstein
2018-01-07 18:07 ` [PATCH 1/7] open_by_handle: store and load file handles from file Amir Goldstein
2018-01-11 11:59   ` Eryu Guan
2018-01-11 15:59     ` Amir Goldstein
2018-01-23 13:56     ` Amir Goldstein
2018-01-07 18:07 ` [PATCH 2/7] open_by_handle: verify dir content only with -r flag Amir Goldstein
2018-01-07 18:07 ` [PATCH 3/7] generic/exportfs: golden output is not silent Amir Goldstein
2018-01-07 18:07 ` [PATCH 4/7] generic/exportfs: store and load file handles from file Amir Goldstein
2018-01-07 18:07 ` Amir Goldstein [this message]
2018-01-07 18:07 ` [PATCH 6/7] overlay: test encode/decode overlay file handles Amir Goldstein
2018-01-16  7:38   ` Eryu Guan
2018-01-16 10:53     ` Amir Goldstein
2018-01-16 11:06       ` Eryu Guan
2018-01-16 15:09         ` Amir Goldstein
2018-01-07 18:07 ` [PATCH 7/7] overlay: test encode/decode of non-samefs " Amir Goldstein
2018-01-16  7:42   ` Eryu Guan
2018-01-16  8:46     ` Amir Goldstein
2018-01-11 11:43 ` [PATCH 0/7] Overlayfs exportfs tests Eryu Guan
2018-01-11 11:52   ` Amir Goldstein
2018-01-12 11:52     ` Eryu Guan
2018-01-12 13:07       ` 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=1515348445-1403-6-git-send-email-amir73il@gmail.com \
    --to=amir73il@gmail.com \
    --cc=bfields@fieldses.org \
    --cc=eguan@redhat.com \
    --cc=fstests@vger.kernel.org \
    --cc=jlayton@poochiereds.net \
    --cc=linux-fsdevel@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;
as well as URLs for NNTP newsgroup(s).