generic/033: Check that the 'fzero' operations supports KEEP_SIZE
Subsystems (2)
Anna Schumaker
maintainerPATCH 1/1 generic/033: Check that the 'fzero' operations supports KEEP_SIZE
From: Anna Schumaker <[email protected]>
Otherwise this test will fail on filesystems that implement FALLOC_FL_ZERO_RANGE but not the optional FALLOC_FL_KEEP_SIZE flag.
--- tests/generic/033 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/generic/033 +1 -1
@@ -20,7 +20,7 @@ _begin_fstest auto quick rw zero # Modify as appropriate. _require_scratch -_require_xfs_io_command "fzero" +_require_xfs_io_command "fzero" "-k" _scratch_mkfs >/dev/null 2>&1 _scratch_mount
Signature · 1 line
2.49.0
Quoted 15 lines · Anna Schumaker
From: Anna Schumaker <[email protected]>
Otherwise this test will fail on filesystems that implement
FALLOC_FL_ZERO_RANGEbut not the optionalFALLOC_FL_KEEP_SIZEflag.Signed-off-by Anna Schumaker <[email protected]>--- tests/generic/033 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tests/generic/033 +0
-0
tests/generic/033 _begin_fstest auto quick rw zero · line 23
Quoted 5 lines
tests/generic/033 +1
-1@@ -20,7 +20,7 @@ _begin_fstest auto quick rw zero # Modify as appropriate. _require_scratch -_require_xfs_io_command "fzero" +_require_xfs_io_command "fzero" "-k"
I wonder, does this test even need KEEP_SIZE? It writes 64MB to the file, then it fzeros every other 4k up to (64M-4k), then fzeroes everything else. AFAICT the fzero commands never exceed the file size...though I could be wrong.
--D
Quoted 7 lines
tests/generic/033 +0
-0_scratch_mkfs >/dev/null 2>&1 _scratch_mountSignature · 1 line
2.49.0
Quoted 17 lines · Darrick J. Wong
Quoted 16 lines · Anna Schumaker
From: Anna Schumaker <[email protected]>
Otherwise this test will fail on filesystems that implement
FALLOC_FL_ZERO_RANGEbut not the optionalFALLOC_FL_KEEP_SIZEflag.Signed-off-by Anna Schumaker <[email protected]>--- tests/generic/033 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tests/generic/033 +0
-0@@ -20,7 +20,7 @@ _begin_fstest auto quick rw zero
Quoted 9 lines
tests/generic/033 _begin_fstest auto quick rw zero · line 23
Quoted 4 lines
tests/generic/033 +1
-1# Modify as appropriate. _require_scratch -_require_xfs_io_command "fzero" +_require_xfs_io_command "fzero" "-k"I wonder, does this test even need
KEEP_SIZE? It writes 64MB to the file, then it fzeros every other 4k up to (64M-4k), then fzeroes everything else. AFAICT the fzero commands never exceed the file size...though I could be wrong.
Hmm... I think you're right, the code logic is:
bytes=$((64 * 1024))
$XFS_IO_PROG -f -c "pwrite 0 $bytes" $file
endoff=$((bytes - 4096))
for i in $(seq 0 8192 $endoff); do
$XFS_IO_PROG -c "fzero -k $i 4k" $file
done
for i in $(seq 4096 8192 $endoff); do
$XFS_IO_PROG -c "fzero -k $i 4k" $file
doneSo looks like the offset+len isn't greater than the file size. So we might can remove the "-k" directly. What do you think ?
Thanks,
Zorro
Quoted 11 lines
--D
Quoted 7 lines
tests/generic/033 +0
-0_scratch_mkfs >/dev/null 2>&1 _scratch_mountSignature · 1 line
2.49.0
Quoted 40 lines · Zorro Lang
Quoted 17 lines · Darrick J. Wong
Quoted 16 lines · Anna Schumaker
From: Anna Schumaker <[email protected]>
Otherwise this test will fail on filesystems that implement
FALLOC_FL_ZERO_RANGEbut not the optionalFALLOC_FL_KEEP_SIZEflag.Signed-off-by Anna Schumaker <[email protected]>--- tests/generic/033 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tests/generic/033 +0
-0@@ -20,7 +20,7 @@ _begin_fstest auto quick rw zeroQuoted 9 lines
tests/generic/033 _begin_fstest auto quick rw zero · line 23
Quoted 4 lines
tests/generic/033 +1
-1# Modify as appropriate. _require_scratch -_require_xfs_io_command "fzero" +_require_xfs_io_command "fzero" "-k"I wonder, does this test even need
KEEP_SIZE? It writes 64MB to the file, then it fzeros every other 4k up to (64M-4k), then fzeroes everything else. AFAICT the fzero commands never exceed the file size...though I could be wrong.Hmm... I think you're right, the code logic is:
bytes=$((64 * 1024)) $XFS_IO_PROG -f -c "pwrite 0 $bytes" $file endoff=$((bytes - 4096)) for i in $(seq 0 8192 $endoff); do $XFS_IO_PROG -c "fzero -k $i 4k" $file done for i in $(seq 4096 8192 $endoff); do $XFS_IO_PROG -c "fzero -k $i 4k" $file done
Quoted 2 lines
So looks like the offset+len isn't greater than the file size. So we might can remove the "-k" directly. What do you think ?
I quickly tested this with my NFS ZERO_RANGE patch, and didn't have any problems. I'll send a v2 removing the "-k" argument in a few minutes!
Anna
Quoted 16 lines
Thanks,
ZorroQuoted 11 lines
--D
Quoted 7 lines
tests/generic/033 +0
-0_scratch_mkfs >/dev/null 2>&1 _scratch_mountSignature · 1 line
2.49.0