mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] generic/365: Fix false failure when mapping ends with free space
@ 2025-08-05  9:25 Ojaswin Mujoo
  2025-08-21 11:05 ` Disha Goel
  2025-08-25 15:29 ` Zorro Lang
  0 siblings, 2 replies; 5+ messages in thread
From: Ojaswin Mujoo @ 2025-08-05  9:25 UTC (permalink / raw)
  To: Zorro Lang, fstests; +Cc: Ritesh Harjani, djwong, linux-kernel

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-08-29 17:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-08-05  9:25 [PATCH] generic/365: Fix false failure when mapping ends with free space Ojaswin Mujoo
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

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®