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: Miklos Szeredi <miklos@szeredi.hu>, Xiong Zhou <xzhou@redhat.com>,
	linux-unionfs@vger.kernel.org, fstests@vger.kernel.org
Subject: [PATCH 2/4] overlay/017: use t_dir_type to find file by d_ino
Date: Thu, 11 May 2017 09:55:08 +0300	[thread overview]
Message-ID: <1494485710-2400-3-git-send-email-amir73il@gmail.com> (raw)
In-Reply-To: <1494485710-2400-1-git-send-email-amir73il@gmail.com>

'find -ino' is this test was supposed to filter files by inode number
that was recorded with 'ls -i' to compare st_ino returned by stat(2)
with d_ino returned by getdents64(2).

It turns out that on some systems, 'find -ino' uses stat(2) for
filtering by inode number, which is not what we want.

Use the auxiliary program t_dir_type to filter files by inode number
instead.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
---
 tests/overlay/017 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/overlay/017 b/tests/overlay/017
index fabfbb5..bb467f7 100755
--- a/tests/overlay/017
+++ b/tests/overlay/017
@@ -56,6 +56,7 @@ _supported_fs overlay
 _supported_os Linux
 _require_scratch
 _require_test_program "af_unix"
+_require_test_program "t_dir_type"
 
 rm -f $seqres.full
 
@@ -107,7 +108,7 @@ function check_inode_numbers()
 	# Test constant readdir(3)/getdents(2) d_ino -
 	#   Expect to find file by inode number
 	cat $before | while read ino f; do
-		find $dir/ -maxdepth 1 -inum $ino | grep -q $f || \
+		$here/src/t_dir_type $dir $ino | grep -q $f || \
 			echo "$f not found by ino $ino (from $before)"
 	done
 }
-- 
2.7.4


  parent reply	other threads:[~2017-05-11  6:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-11  6:55 [PATCH 0/4] overlay/017: fix false negatives Amir Goldstein
2017-05-11  6:55 ` [PATCH 1/4] src/t_dir_type: support filtering by inode number Amir Goldstein
2017-05-11  6:55 ` Amir Goldstein [this message]
2017-05-11  6:55 ` [PATCH 3/4] overlay/017: test consistent st_ino/d_ino for hardlinks Amir Goldstein
2017-05-11  6:55 ` [PATCH 4/4] overlay: tag tests 016-018 as experimental Amir Goldstein
2017-05-12  4:01   ` Eryu Guan
2017-05-12  6:16     ` 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=1494485710-2400-3-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=xzhou@redhat.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