Skip to contentSkip to conversation

generic/033: Don't call 'fzero' with the KEEP_SIZE flag

PATCH In review Anna Schumaker 3 participants 3 messages Apr 25, 2025 – Apr 26, 2025

Subsystems (2)
lore
Share & tools
lore

Anna Schumaker

author maintainer
#0 lore raw

PATCH v2 1/1 generic/033: Don't call 'fzero' with the KEEP_SIZE flag

From: Anna Schumaker <[email protected]>

None of the fzero calls in this test end up writing past the end of the file, so this flag is unnecessary and can cause the test to fail on filesystems that don't implement FALLOC_FL_KEEP_SIZE.

---
 tests/generic/033 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tests/generic/033 +2 -2
index a9a9ff5a3431..b7df56b82619 100755
@@ -37,12 +37,12 @@ $XFS_IO_PROG -f -c "pwrite 0 $bytes" $file >> $seqres.full 2>&1
 # delalloc blocks and convert the ranges to unwritten.
 endoff=$((bytes - 4096))
 for i in $(seq 0 8192 $endoff); do
-	$XFS_IO_PROG -c "fzero -k $i 4k" $file >> $seqres.full 2>&1
+	$XFS_IO_PROG -c "fzero $i 4k" $file >> $seqres.full 2>&1
 done
 
 # now zero the opposite set to remove remaining delalloc extents
 for i in $(seq 4096 8192 $endoff); do
-	$XFS_IO_PROG -c "fzero -k $i 4k" $file >> $seqres.full 2>&1
+	$XFS_IO_PROG -c "fzero $i 4k" $file >> $seqres.full 2>&1
 done
 
 _scratch_cycle_mount
Signature · 1 line
2.49.0
Reviewed-by on v2 1/1
#1 lore raw
Quoted 7 lines · Anna Schumaker

From: Anna Schumaker <[email protected]>

None of the fzero calls in this test end up writing past the end of the file, so this flag is unnecessary and can cause the test to fail on filesystems that don't implement FALLOC_FL_KEEP_SIZE.

Looks good to me,

--D

Quoted 27 lines
---
 tests/generic/033 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tests/generic/033 +2 -2
index a9a9ff5a3431..b7df56b82619 100755
@@ -37,12 +37,12 @@ $XFS_IO_PROG -f -c "pwrite 0 $bytes" $file >> $seqres.full 2>&1
 # delalloc blocks and convert the ranges to unwritten.
 endoff=$((bytes - 4096))
 for i in $(seq 0 8192 $endoff); do
-	$XFS_IO_PROG -c "fzero -k $i 4k" $file >> $seqres.full 2>&1
+	$XFS_IO_PROG -c "fzero $i 4k" $file >> $seqres.full 2>&1
 done
 
 # now zero the opposite set to remove remaining delalloc extents
 for i in $(seq 4096 8192 $endoff); do
-	$XFS_IO_PROG -c "fzero -k $i 4k" $file >> $seqres.full 2>&1
+	$XFS_IO_PROG -c "fzero $i 4k" $file >> $seqres.full 2>&1
 done
 
 _scratch_cycle_mount
Signature · 1 line
2.49.0
Reviewed-by on v2 1/1
#2 lore raw
In reply to Anna Schumaker
Quoted 8 lines · Anna Schumaker

From: Anna Schumaker <[email protected]>

None of the fzero calls in this test end up writing past the end of the file, so this flag is unnecessary and can cause the test to fail on filesystems that don't implement FALLOC_FL_KEEP_SIZE.

---

This version is good to me,

Quoted 26 lines
 tests/generic/033 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tests/generic/033 +2 -2
index a9a9ff5a3431..b7df56b82619 100755
@@ -37,12 +37,12 @@ $XFS_IO_PROG -f -c "pwrite 0 $bytes" $file >> $seqres.full 2>&1
 # delalloc blocks and convert the ranges to unwritten.
 endoff=$((bytes - 4096))
 for i in $(seq 0 8192 $endoff); do
-	$XFS_IO_PROG -c "fzero -k $i 4k" $file >> $seqres.full 2>&1
+	$XFS_IO_PROG -c "fzero $i 4k" $file >> $seqres.full 2>&1
 done
 
 # now zero the opposite set to remove remaining delalloc extents
 for i in $(seq 4096 8192 $endoff); do
-	$XFS_IO_PROG -c "fzero -k $i 4k" $file >> $seqres.full 2>&1
+	$XFS_IO_PROG -c "fzero $i 4k" $file >> $seqres.full 2>&1
 done
 
 _scratch_cycle_mount
Signature · 1 line
2.49.0