From: Ojaswin Mujoo <ojaswin@linux.ibm.com>
To: Zorro Lang <zlang@redhat.com>, fstests@vger.kernel.org
Cc: Ritesh Harjani <ritesh.list@gmail.com>,
djwong@kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] generic/365: Fix false failure when mapping ends with free space
Date: Tue, 5 Aug 2025 14:55:56 +0530 [thread overview]
Message-ID: <cc80fdb62151d677809f2eb36eadebd3720c8701.1754385487.git.ojaswin@linux.ibm.com> (raw)
If we have a small FS where the first free space mapping is also the
last mapping of the FS, then the following sub-test fails:
echo "test whatever came after freesp"
$XFS_IO_PROG -c "fsmap -d $((freesp_end + 2)) $((freesp_end + 3))" $SCRATCH_MNT
since there is nothing after the freespace. Fix this by punching a 1M
hole in a 3M file to ensure that the first free space is always
surrounded by allocated blocks.
Signed-off-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>
---
tests/generic/365 | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tests/generic/365 b/tests/generic/365
index 36cb2530..bbadae71 100755
--- a/tests/generic/365
+++ b/tests/generic/365
@@ -32,6 +32,10 @@ if ((blksz < 2048)); then
_notrun "test requires at least 4 bblocks per fsblock"
fi
+# This makes sure there is free space surrounded by allocated blocks, which
+# is needed for some sub tests.
+$XFS_IO_PROG -fc 'falloc 0 3M' -c 'fpunch 1M 1M' -c 'fsync' $SCRATCH_MNT/f
+
$XFS_IO_PROG -c 'fsmap' $SCRATCH_MNT >> $seqres.full
find_freesp() {
--
2.49.0
next reply other threads:[~2025-08-05 9:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-05 9:25 Ojaswin Mujoo [this message]
2025-08-21 11:05 ` Disha Goel
2025-08-25 15:29 ` Zorro Lang
2025-08-28 15:00 ` Ojaswin Mujoo
2025-08-29 17:09 ` Zorro Lang
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=cc80fdb62151d677809f2eb36eadebd3720c8701.1754385487.git.ojaswin@linux.ibm.com \
--to=ojaswin@linux.ibm.com \
--cc=djwong@kernel.org \
--cc=fstests@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ritesh.list@gmail.com \
--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
all inboxes | Powered by JetHome®