fstests.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: darrick.wong@oracle.com, guaneryu@gmail.com
Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org
Subject: [PATCH 5/9] xfs/327: fix inode reflink flag checking
Date: Tue, 27 Oct 2020 12:02:02 -0700	[thread overview]
Message-ID: <160382532250.1202316.4733915561999380155.stgit@magnolia> (raw)
In-Reply-To: <160382528936.1202316.2338876126552815991.stgit@magnolia>

From: Darrick J. Wong <darrick.wong@oracle.com>

This is a regression test that tried to make sure that repair correctly
clears the XFS inode reflink flag when it detects files that do not
share any blocks.  However, it does this checking by looking at the
(online) lsattr output.  This worked fine during development when we
exposed the reflink state via the stat ioctls, but that has long since
been removed.  Now the only way to check is via xfs_db, so switch it to
use that.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 tests/xfs/327     |   18 ++++++++++++++++--
 tests/xfs/327.out |   13 +++++++------
 2 files changed, 23 insertions(+), 8 deletions(-)


diff --git a/tests/xfs/327 b/tests/xfs/327
index 017e2a84..7a14798f 100755
--- a/tests/xfs/327
+++ b/tests/xfs/327
@@ -49,10 +49,21 @@ seq 1 $nr | while read i; do
 done
 sync
 
+ino_0=$(stat -c '%i' $SCRATCH_MNT/file.0)
+ino_64=$(stat -c '%i' $SCRATCH_MNT/file.64)
+ino_128=$(stat -c '%i' $SCRATCH_MNT/file.128)
+
+echo "Check filesystem"
+_scratch_unmount
+_scratch_xfs_db -c "inode $ino_0" -c print \
+	-c "inode $ino_64" -c print \
+	-c "inode $ino_128" -c print | grep reflink | sed -e 's/^v[0-9]*/vX/g'
+_scratch_mount
+
 echo "Check files"
 for i in 0 $((nr / 2)) $nr; do
 	md5sum $SCRATCH_MNT/file.$i | _filter_scratch
-	$XFS_IO_PROG -c 'lsattr -v' $SCRATCH_MNT/file.$i | _filter_scratch
+	$XFS_IO_PROG -c 'lsattr -v' $SCRATCH_MNT/file.$i >> $seqres.full
 done
 
 echo "CoW all files"
@@ -63,12 +74,15 @@ done
 echo "Repair filesystem"
 _scratch_unmount
 _repair_scratch_fs >> $seqres.full
+_scratch_xfs_db -c "inode $ino_0" -c print \
+	-c "inode $ino_64" -c print \
+	-c "inode $ino_128" -c print | grep reflink | sed -e 's/^v[0-9]*/vX/g'
 _scratch_mount
 
 echo "Check files again"
 for i in 0 $((nr / 2)) $nr; do
 	md5sum $SCRATCH_MNT/file.$i | _filter_scratch
-	$XFS_IO_PROG -c 'lsattr -v' $SCRATCH_MNT/file.$i | _filter_scratch
+	$XFS_IO_PROG -c 'lsattr -v' $SCRATCH_MNT/file.$i >> $seqres.full
 done
 
 echo "Done"
diff --git a/tests/xfs/327.out b/tests/xfs/327.out
index 5b3cba21..0e204205 100644
--- a/tests/xfs/327.out
+++ b/tests/xfs/327.out
@@ -1,20 +1,21 @@
 QA output created by 327
 Format filesystem
 Create files
+Check filesystem
+vX.reflink = 1
+vX.reflink = 1
+vX.reflink = 1
 Check files
 8fa14cdd754f91cc6554c9e71929cce7  SCRATCH_MNT/file.0
-[] SCRATCH_MNT/file.0 
 8fa14cdd754f91cc6554c9e71929cce7  SCRATCH_MNT/file.64
-[] SCRATCH_MNT/file.64 
 8fa14cdd754f91cc6554c9e71929cce7  SCRATCH_MNT/file.128
-[] SCRATCH_MNT/file.128 
 CoW all files
 Repair filesystem
+vX.reflink = 0
+vX.reflink = 0
+vX.reflink = 0
 Check files again
 8fa14cdd754f91cc6554c9e71929cce7  SCRATCH_MNT/file.0
-[] SCRATCH_MNT/file.0 
 0f17fd72b7bbf5bda0ff433e6d1fc118  SCRATCH_MNT/file.64
-[] SCRATCH_MNT/file.64 
 0f17fd72b7bbf5bda0ff433e6d1fc118  SCRATCH_MNT/file.128
-[] SCRATCH_MNT/file.128 
 Done


  parent reply	other threads:[~2020-10-27 19:04 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-27 19:01 [PATCH 0/9] xfstests: random fixes Darrick J. Wong
2020-10-27 19:01 ` [PATCH 1/9] common: extract rt extent size for _get_file_block_size Darrick J. Wong
2020-10-28  7:41   ` Christoph Hellwig
2020-10-28 22:24     ` Darrick J. Wong
2020-10-27 19:01 ` [PATCH 2/9] xfs/520: disable external devices Darrick J. Wong
2020-10-28  7:41   ` Christoph Hellwig
2020-10-27 19:01 ` [PATCH 3/9] xfs/341: fix test when rextsize > 1 Darrick J. Wong
2020-10-28  7:41   ` Christoph Hellwig
2020-10-27 19:01 ` [PATCH 4/9] various: replace _get_block_size with _get_file_block_size when needed Darrick J. Wong
2020-10-28  7:42   ` Christoph Hellwig
2020-10-27 19:02 ` Darrick J. Wong [this message]
2020-10-28  7:42   ` [PATCH 5/9] xfs/327: fix inode reflink flag checking Christoph Hellwig
2020-10-27 19:02 ` [PATCH 6/9] xfs/27[26]: force realtime on or off as needed Darrick J. Wong
2020-10-28  7:43   ` Christoph Hellwig
2020-10-27 19:02 ` [PATCH 7/9] xfs/030: hide the btree levels check errors Darrick J. Wong
2020-10-28  7:43   ` Christoph Hellwig
2020-10-27 19:02 ` [PATCH 8/9] check: run tests in a systemd scope for mandatory test cleanup Darrick J. Wong
2020-10-28  7:44   ` Christoph Hellwig
2020-10-28 16:58     ` Darrick J. Wong
2020-10-29  1:04     ` Darrick J. Wong
2020-11-02 21:37   ` Darrick J. Wong
2020-10-27 19:02 ` [PATCH 9/9] common/populate: make sure _scratch_xfs_populate puts its files on the data device Darrick J. Wong
2020-10-28  7:44   ` Christoph Hellwig
2020-10-28 16:27     ` Darrick J. Wong
2020-11-08 10:05 ` [PATCH 0/9] xfstests: random fixes Eryu Guan
2020-11-08 17:23   ` 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=160382532250.1202316.4733915561999380155.stgit@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=fstests@vger.kernel.org \
    --cc=guaneryu@gmail.com \
    --cc=linux-xfs@vger.kernel.org \
    /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).