xfs/131: test iomap zero range via fsx and error tag
PATCH 1/1 xfs/131: test iomap zero range via fsx and error tag
iomap supports a zero range operation based on buffered writes. This mechanism is used in limited spots, such as partial block zeroing, etc., because usually for larger zeroing ops it is more efficient to punch a hole and allocate unwritten extents.
This means iomap zero range has limited production test coverage even though it has some particular corner cases that warrant test coverage. XFS supports an error injection knob to force use of iomap zero range on fallocate zero range operations. Add a test to run fsx with this knob enabled to provide more zeroing test coverage.
---
FYI, this test is intended to go along with this patch[1] that introduces the errortag.
[1] https://lore.kernel.org/linux-fsdevel/[email protected]/
tests/xfs/131 | 26 ++++++++++++++++++++++++++ tests/xfs/131.out | 2 ++ 2 files changed, 28 insertions(+) create mode 100755 tests/xfs/131 create mode 100644 tests/xfs/131.out
tests/xfs/131 new file +26 -0
@@ -0,0 +1,26 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2025 Red Hat, Inc.. All Rights Reserved. +# +# FS QA Test 131 +# +# Run fsx with XFS force_zero_range error injection enabled. This is a proxy +# test for iomap zero range. Zero range is used in limited cases by default, +# such as EOF zeroing on file extension, etc. This error tag forces use of iomap +# zero range for fallocate zero range operations. +# +. ./common/preamble +_begin_fstest auto quick zero + +# Import common functions. +. ./common/inject + +# Modify as appropriate. +_require_test +_require_xfs_io_error_injection "force_zero_range" + +_test_inject_error "force_zero_range" +run_fsx "-q -S 0 -N 100000" + +# success, all done +_exit 0
tests/xfs/131.out new file +2 -0
@@ -0,0 +1,2 @@ +QA output created by 131 +fsx -q -S 0 -N 100000
Signature · 1 line
2.50.1
Quoted 44 lines · Brian Foster
iomap supports a zero range operation based on buffered writes. This mechanism is used in limited spots, such as partial block zeroing, etc., because usually for larger zeroing ops it is more efficient to punch a hole and allocate unwritten extents.
This means iomap zero range has limited production test coverage even though it has some particular corner cases that warrant test coverage. XFS supports an error injection knob to force use of iomap zero range on fallocate zero range operations. Add a test to run fsx with this knob enabled to provide more zeroing test coverage.
Signed-off-by Brian Foster <[email protected]>---
FYI, this test is intended to go along with this patch[1] that introduces the errortag.
[1] https://lore.kernel.org/linux-fsdevel/[email protected]/
tests/xfs/131 | 26 ++++++++++++++++++++++++++ tests/xfs/131.out | 2 ++ 2 files changed, 28 insertions(+) create mode 100755 tests/xfs/131 create mode 100644 tests/xfs/131.outtests/xfs/131 new file +13
-0@@ -0,0 +1,26 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2025 Red Hat, Inc.. All Rights Reserved. +# +# FS QA Test 131 +# +# Run fsx with XFS force_zero_range error injection enabled. This is a proxy +# test for iomap zero range. Zero range is used in limited cases by default, +# such as EOF zeroing on file extension, etc. This error tag forces use of iomap +# zero range for fallocate zero range operations. +# +. ./common/preamble +_begin_fstest auto quick zero
tests/xfs/131 line 23
Quoted 10 lines
tests/xfs/131 new file +10
-0+ +# Import common functions. +. ./common/inject + +# Modify as appropriate. +_require_test +_require_xfs_io_error_injection "force_zero_range" + +_test_inject_error "force_zero_range" +run_fsx "-q -S 0 -N 100000"
Just check with you, if you hope to have a $TIME_FACTOR with -N at here.
This test case looks good to me with this patch:
https://lore.kernel.org/linux-xfs/[email protected]/
Quoted 15 lines
tests/xfs/131 new file +3
-0+ +# success, all done +_exit 0tests/xfs/131.out new file +2
-0@@ -0,0 +1,2 @@ +QA output created by 131 +fsx -q -S 0 -N 100000Signature · 1 line
2.50.1
Quoted 49 lines · Zorro Lang
Quoted 48 lines · Brian Foster
iomap supports a zero range operation based on buffered writes. This mechanism is used in limited spots, such as partial block zeroing, etc., because usually for larger zeroing ops it is more efficient to punch a hole and allocate unwritten extents.
This means iomap zero range has limited production test coverage even though it has some particular corner cases that warrant test coverage. XFS supports an error injection knob to force use of iomap zero range on fallocate zero range operations. Add a test to run fsx with this knob enabled to provide more zeroing test coverage.
Signed-off-by Brian Foster <[email protected]>---
FYI, this test is intended to go along with this patch[1] that introduces the errortag.
[1] https://lore.kernel.org/linux-fsdevel/[email protected]/
tests/xfs/131 | 26 ++++++++++++++++++++++++++ tests/xfs/131.out | 2 ++ 2 files changed, 28 insertions(+) create mode 100755 tests/xfs/131 create mode 100644 tests/xfs/131.outtests/xfs/131 new file +17
-0@@ -0,0 +1,26 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2025 Red Hat, Inc.. All Rights Reserved. +# +# FS QA Test 131 +# +# Run fsx with XFS force_zero_range error injection enabled. This is a proxy +# test for iomap zero range. Zero range is used in limited cases by default, +# such as EOF zeroing on file extension, etc. This error tag forces use of iomap +# zero range for fallocate zero range operations. +# +. ./common/preamble +_begin_fstest auto quick zero + +# Import common functions. +. ./common/inject +
Quoted 9 lines
tests/xfs/131 line 23
Quoted 6 lines
tests/xfs/131 new file +6
-0+# Modify as appropriate. +_require_test +_require_xfs_io_error_injection "force_zero_range" + +_test_inject_error "force_zero_range" +run_fsx "-q -S 0 -N 100000"Just check with you, if you hope to have a $TIME_FACTOR with -N at here.
So do you just mean to make it 100000 * $TIME_FACTOR so the runtime can be increased via configuration, if desired? If so, that sounds reasonable to me (same for your tweak in the other email as well).
Quoted 5 lines
This test case looks good to me with this patch:
https://lore.kernel.org/linux-xfs/[email protected]/Reviewed-by Zorro Lang <[email protected]>
Thanks!
Brian
Quoted 16 lines
Quoted 15 lines
tests/xfs/131 new file +3
-0+ +# success, all done +_exit 0tests/xfs/131.out new file +2
-0@@ -0,0 +1,2 @@ +QA output created by 131 +fsx -q -S 0 -N 100000Signature · 1 line
2.50.1
Quoted 60 lines · Brian Foster
Quoted 49 lines · Zorro Lang
Quoted 48 lines · Brian Foster
iomap supports a zero range operation based on buffered writes. This mechanism is used in limited spots, such as partial block zeroing, etc., because usually for larger zeroing ops it is more efficient to punch a hole and allocate unwritten extents.
This means iomap zero range has limited production test coverage even though it has some particular corner cases that warrant test coverage. XFS supports an error injection knob to force use of iomap zero range on fallocate zero range operations. Add a test to run fsx with this knob enabled to provide more zeroing test coverage.
Signed-off-by Brian Foster <[email protected]>---
FYI, this test is intended to go along with this patch[1] that introduces the errortag.
[1] https://lore.kernel.org/linux-fsdevel/[email protected]/
tests/xfs/131 | 26 ++++++++++++++++++++++++++ tests/xfs/131.out | 2 ++ 2 files changed, 28 insertions(+) create mode 100755 tests/xfs/131 create mode 100644 tests/xfs/131.outtests/xfs/131 new file +17
-0@@ -0,0 +1,26 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2025 Red Hat, Inc.. All Rights Reserved. +# +# FS QA Test 131 +# +# Run fsx with XFS force_zero_range error injection enabled. This is a proxy +# test for iomap zero range. Zero range is used in limited cases by default, +# such as EOF zeroing on file extension, etc. This error tag forces use of iomap +# zero range for fallocate zero range operations. +# +. ./common/preamble +_begin_fstest auto quick zero + +# Import common functions. +. ./common/inject +Quoted 9 lines
tests/xfs/131 line 23
Quoted 6 lines
tests/xfs/131 new file +6
-0+# Modify as appropriate. +_require_test +_require_xfs_io_error_injection "force_zero_range" + +_test_inject_error "force_zero_range" +run_fsx "-q -S 0 -N 100000"Just check with you, if you hope to have a $TIME_FACTOR with -N at here.
Quoted 3 lines
So do you just mean to make it 100000 * $TIME_FACTOR so the runtime can be increased via configuration, if desired? If so, that sounds reasonable to me (same for your tweak in the other email as well).
Sure, only $TIME_FACTOR. As this is an error injection test, so I think we don't need to add this test to soak group and use $SOAK_DURATION (except you intend that). I'll merge this patch with the $TIME_FACTOR.
Thanks,
Zorro
Quoted 28 lines
Quoted 6 lines
This test case looks good to me with this patch:
https://lore.kernel.org/linux-xfs/[email protected]/Reviewed-by Zorro Lang <[email protected]>Thanks!
Brian
Quoted 16 lines
Quoted 15 lines
tests/xfs/131 new file +3
-0+ +# success, all done +_exit 0tests/xfs/131.out new file +2
-0@@ -0,0 +1,2 @@ +QA output created by 131 +fsx -q -S 0 -N 100000Signature · 1 line
2.50.1
Quoted 44 lines · Brian Foster
iomap supports a zero range operation based on buffered writes. This mechanism is used in limited spots, such as partial block zeroing, etc., because usually for larger zeroing ops it is more efficient to punch a hole and allocate unwritten extents.
This means iomap zero range has limited production test coverage even though it has some particular corner cases that warrant test coverage. XFS supports an error injection knob to force use of iomap zero range on fallocate zero range operations. Add a test to run fsx with this knob enabled to provide more zeroing test coverage.
Signed-off-by Brian Foster <[email protected]>---
FYI, this test is intended to go along with this patch[1] that introduces the errortag.
[1] https://lore.kernel.org/linux-fsdevel/[email protected]/
tests/xfs/131 | 26 ++++++++++++++++++++++++++ tests/xfs/131.out | 2 ++ 2 files changed, 28 insertions(+) create mode 100755 tests/xfs/131 create mode 100644 tests/xfs/131.outtests/xfs/131 new file +13
-0@@ -0,0 +1,26 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2025 Red Hat, Inc.. All Rights Reserved. +# +# FS QA Test 131 +# +# Run fsx with XFS force_zero_range error injection enabled. This is a proxy +# test for iomap zero range. Zero range is used in limited cases by default, +# such as EOF zeroing on file extension, etc. This error tag forces use of iomap +# zero range for fallocate zero range operations. +# +. ./common/preamble +_begin_fstest auto quick zero
tests/xfs/131 line 23
Quoted 10 lines
tests/xfs/131 new file +10
-0+ +# Import common functions. +. ./common/inject + +# Modify as appropriate. +_require_test +_require_xfs_io_error_injection "force_zero_range" + +_test_inject_error "force_zero_range" +run_fsx "-q -S 0 -N 100000"
Just a picky review point:
As run_fsx() function use "$@", so the double quotation marks ("-q -S 0 -N 100000") don't make sense I think, although it works. I'll help to remove it when I merge this patch.
Thanks,
Zorro
Quoted 15 lines
tests/xfs/131 new file +3
-0+ +# success, all done +_exit 0tests/xfs/131.out new file +2
-0@@ -0,0 +1,2 @@ +QA output created by 131 +fsx -q -S 0 -N 100000Signature · 1 line
2.50.1