From: "Darrick J. Wong" <djwong@kernel.org>
To: zlang@redhat.com
Cc: hch@lst.de, linux-xfs@vger.kernel.org, fstests@vger.kernel.org
Subject: [PATCH 5/3] xfs/818: fix some design issues
Date: Fri, 21 Mar 2025 09:54:18 -0700 [thread overview]
Message-ID: <20250321165418.GP2803749@frogsfrogsfrogs> (raw)
In-Reply-To: <174182089094.1400713.5283745853237966823.stgit@frogsfrogsfrogs>
From: Darrick J. Wong <djwong@kernel.org>
While QA'ing zoned filesystem support, I discovered some design errors
in this test:
1) Since we're test formatting a sparse file on an xfs filesystem,
there's no need to play games with optimal device size; we can create
a totally sparse file that's the same size as SCRATCH_DEV.
2) mkfs.xfs cannot create realtime files, so if it fails with that,
there's no need to continue the test.
3) If mkfs -p fails for none of the proscribed reasons, it should exit
the test. The final cat $tmp.mkfs will take care of tweaking the golden
output to register the test failure for further investigation.
Cc: <fstests@vger.kernel.org> # v2025.03.09
Fixes: 6d39dc34e61e11 ("xfs: test filesystem creation with xfs_protofile")
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
---
tests/xfs/818 | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/tests/xfs/818 b/tests/xfs/818
index aeb462353df7e9..bc809390b9e340 100755
--- a/tests/xfs/818
+++ b/tests/xfs/818
@@ -75,9 +75,8 @@ _run_fsstress -n 1000 -d $SCRATCH_MNT/newfiles
make_stat $SCRATCH_MNT before
make_md5 $SCRATCH_MNT before
-kb_needed=$(du -k -s $SCRATCH_MNT | awk '{print $1}')
-img_size=$((kb_needed * 2))
-test "$img_size" -lt $((300 * 1024)) && img_size=$((300 * 1024))
+scratch_sectors="$(blockdev --getsz $SCRATCH_DEV)"
+img_size=$((scratch_sectors * 512 / 1024))
echo "Clone image with protofile"
$XFS_PROTOFILE_PROG $SCRATCH_MNT > $testfiles/protofile
@@ -99,7 +98,21 @@ if ! _try_mkfs_dev -p $testfiles/protofile $testfiles/image &> $tmp.mkfs; then
if grep -q 'No space left on device' $tmp.mkfs; then
_notrun "not enough space in filesystem"
fi
+
+ # mkfs cannot create realtime files.
+ #
+ # If zoned=1 is in MKFS_OPTIONS, mkfs will create an internal realtime
+ # volume with rtinherit=1 and fail, so we need to _notrun that case.
+ #
+ # If zoned=1 is /not/ in MKFS_OPTIONS, we didn't pass a realtime device
+ # to mkfs so it will not create realtime files. The format should work
+ # just fine.
+ if grep -q 'creating realtime files from proto file not supported' $tmp.mkfs; then
+ _notrun "mkfs cannot create realtime files"
+ fi
+
cat $tmp.mkfs
+ exit
fi
_mount $testfiles/image $testfiles/mount
next prev parent reply other threads:[~2025-03-21 16:54 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-12 23:07 [PATCHBOMB] fstests: random fixes and 6.14 stragglers Darrick J. Wong
2025-03-12 23:10 ` [PATCHSET 1/3] fstests: test dumping fs directory trees Darrick J. Wong
2025-03-12 23:11 ` [PATCH 1/1] xfs: test filesystem recovery with rdump Darrick J. Wong
2025-03-12 23:10 ` [PATCHSET 2/3] fstests: test handling emoji filenames better Darrick J. Wong
2025-03-12 23:11 ` [PATCH 1/1] generic/45[34]: add colored emoji variants to unicode tests Darrick J. Wong
2025-03-12 23:10 ` [PATCHSET 3/3] fstests: more random fixes for v2025.03.09 Darrick J. Wong
2025-03-12 23:11 ` [PATCH 1/3] xfs/614: determine the sector size of the fs image by doing a test format Darrick J. Wong
2025-03-12 23:11 ` [PATCH 2/3] generic/537: disable quota mount options for pre-metadir rt filesystems Darrick J. Wong
2025-03-21 15:43 ` Darrick J. Wong
2025-03-12 23:12 ` [PATCH 3/3] check: don't allow TEST_DIR/SCRATCH_MNT to be in /tmp Darrick J. Wong
2025-03-21 21:22 ` Darrick J. Wong
2025-03-14 17:54 ` [PATCH 4/3] common/populate: drop fallocate mode 0 requirement Darrick J. Wong
2025-03-18 5:49 ` Christoph Hellwig
2025-03-21 16:54 ` Darrick J. Wong [this message]
2025-03-23 6:31 ` [PATCH 5/3] xfs/818: fix some design issues Christoph Hellwig
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=20250321165418.GP2803749@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=fstests@vger.kernel.org \
--cc=hch@lst.de \
--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