fstests.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: djwong@kernel.org, zlang@redhat.com
Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me
Subject: [PATCH 13/14] common/parent: check xfs_io parent command paths
Date: Thu, 16 Feb 2023 13:16:57 -0800	[thread overview]
Message-ID: <167657884661.3481377.17754411294910000961.stgit@magnolia> (raw)
In-Reply-To: <167657884480.3481377.14824439551809919632.stgit@magnolia>

From: Darrick J. Wong <djwong@kernel.org>

Make sure that the paths returned by the xfs_io parent command actually
point to the same file.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 common/parent |    8 ++++++++
 1 file changed, 8 insertions(+)


diff --git a/common/parent b/common/parent
index 7e63765d56..96547727d9 100644
--- a/common/parent
+++ b/common/parent
@@ -155,6 +155,14 @@ _verify_parent()
 			"but should be $cino"
 	fi
 
+	# Make sure path printing works by checking that the paths returned
+	# all point to the same inode.
+	local tgt="$SCRATCH_MNT/$child_path"
+	$XFS_IO_PROG -x -c 'parent -p' "$tgt" | while read pptr_path; do
+		test "$tgt" -ef "$pptr_path" || \
+			echo "$tgt parent pointer $pptr_path should be the same file"
+	done
+
 	echo "*** Verified parent pointer:"\
 			"name:$PPNAME, namelen:$PPNAME_LEN"
 	echo "*** Parent pointer OK for child $child_path"


  parent reply	other threads:[~2023-02-16 21:17 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Y+6MxEgswrJMUNOI@magnolia>
2023-02-16 20:32 ` [PATCHSET 00/14] fstests: adjust tests for xfs parent pointers Darrick J. Wong
2023-02-16 21:13   ` [PATCH 01/14] xfs/122: update for " Darrick J. Wong
2023-02-16 21:14   ` [PATCH 02/14] populate: create hardlinks " Darrick J. Wong
2023-02-16 21:14   ` [PATCH 03/14] xfs/021: adapt golden output files " Darrick J. Wong
2023-02-16 21:14   ` [PATCH 04/14] generic/050: adapt " Darrick J. Wong
2023-02-16 21:14   ` [PATCH 05/14] xfs/018: disable parent pointers for this test Darrick J. Wong
2023-02-16 21:15   ` [PATCH 06/14] xfs/306: fix formatting failures with parent pointers Darrick J. Wong
2023-02-16 21:15   ` [PATCH 07/14] common: add helpers for parent pointer tests Darrick J. Wong
2023-02-16 21:15   ` [PATCH 08/14] xfs: add parent pointer test Darrick J. Wong
2023-02-16 21:15   ` [PATCH 09/14] xfs: add multi link " Darrick J. Wong
2023-02-16 21:16   ` [PATCH 10/14] xfs: add parent pointer inject test Darrick J. Wong
2023-02-16 21:16   ` [PATCH 11/14] common/parent: add license and copyright Darrick J. Wong
2023-02-16 21:16   ` [PATCH 12/14] common/parent: don't _fail on missing parent pointer components Darrick J. Wong
2023-02-16 21:16   ` Darrick J. Wong [this message]
2023-02-16 21:17   ` [PATCH 14/14] xfs/851: test xfs_io parent -p too Darrick J. Wong
2023-02-16 20:32 ` [PATCHSET v9r2 0/4] fstests: encode parent pointer name in xattr key Darrick J. Wong
2023-02-16 21:17   ` [PATCH 1/4] misc: adjust for parent pointers with namehashes Darrick J. Wong
2023-02-16 21:17   ` [PATCH 2/4] xfs/021: adjust for short parent pointers with hashes Darrick J. Wong
2023-02-16 21:18   ` [PATCH 3/4] xfs/242: fix _filter_bmap for xfs_io bmap that does rt file properly Darrick J. Wong
2023-02-16 21:18   ` [PATCH 4/4] xfs/021: adjust for short valuelens Darrick J. Wong
2023-02-16 20:32 ` [PATCHSET v9r2 0/1] fstests: use flex arrays for XFS_IOC_GETPARENTS Darrick J. Wong
2023-02-16 21:18   ` [PATCH 1/1] xfs/122: adjust for flex-array XFS_IOC_GETPARENTS ioctl Darrick J. Wong
2023-03-16 19:19 [PATCHSET v10r1d2 00/14] fstests: adjust tests for xfs parent pointers Darrick J. Wong
2023-03-16 19:36 ` [PATCH 13/14] common/parent: check xfs_io parent command paths Darrick J. Wong

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=167657884661.3481377.17754411294910000961.stgit@magnolia \
    --to=djwong@kernel.org \
    --cc=fstests@vger.kernel.org \
    --cc=guan@eryu.me \
    --cc=linux-xfs@vger.kernel.org \
    --cc=zlang@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;
as well as URLs for NNTP newsgroup(s).