Message ID | 20240828181534.41054-5-bfoster@redhat.com (mailing list archive) |
---|---|
State | Not Applicable, archived |
Headers | show |
Series | fstests/fsx: test coverage for eof zeroing | expand |
On Wed, Aug 28, 2024 at 02:15:34PM -0400, Brian Foster wrote: > Filesystem regressions related to partial page zeroing can go > unnoticed for a decent amount of time. A recent example is the issue > of iomap zero range not handling dirty pagecache over unwritten > extents, which leads to wrong behavior on certain file extending > operations (i.e. truncate, write extension, etc.). > > fsx does occasionally uncover these sorts of problems, but failures > can be rare and/or require longer running tests outside what is > typically run via full fstests regression runs. fsx now supports a > mode that injects post-eof data in order to explicitly test partial > eof zeroing behavior. This uncovers certain problems more quickly > and applies coverage more broadly across size changing operations. > > Add a new test that runs an fsx instance (modeled after generic/127) > with eof pollution mode enabled. While the test is generic, it is > currently limited to XFS as that is currently the only known major > fs that does enough zeroing to satisfy the strict semantics expected > by fsx. The long term goal is to uncover and fix issues so more > filesystems can enable this test. > > Signed-off-by: Brian Foster <bfoster@redhat.com> Looks good! Reviewed-by: Darrick J. Wong <djwong@kernel.org> --D > --- > tests/generic/363 | 23 +++++++++++++++++++++++ > tests/generic/363.out | 2 ++ > 2 files changed, 25 insertions(+) > create mode 100755 tests/generic/363 > create mode 100644 tests/generic/363.out > > diff --git a/tests/generic/363 b/tests/generic/363 > new file mode 100755 > index 00000000..477c111c > --- /dev/null > +++ b/tests/generic/363 > @@ -0,0 +1,23 @@ > +#! /bin/bash > +# SPDX-License-Identifier: GPL-2.0 > +# Copyright (c) 2024 Red Hat, Inc. All Rights Reserved. > +# > +# FSQA Test No. 363 > +# > +# Run fsx with EOF pollution enabled. This provides test coverage for partial > +# EOF page/block zeroing for operations that change file size. > +# > + > +. ./common/preamble > +_begin_fstest rw auto > + > +_require_test > + > +# currently only xfs performs enough zeroing to satisfy fsx > +_supported_fs xfs > + > +# on failure, replace -q with -d to see post-eof writes in the dump output > +run_fsx "-q -S 0 -e 1 -N 100000" > + > +status=0 > +exit > diff --git a/tests/generic/363.out b/tests/generic/363.out > new file mode 100644 > index 00000000..3d219cd0 > --- /dev/null > +++ b/tests/generic/363.out > @@ -0,0 +1,2 @@ > +QA output created by 363 > +fsx -q -S 0 -e 1 -N 100000 > -- > 2.45.0 > >
diff --git a/tests/generic/363 b/tests/generic/363 new file mode 100755 index 00000000..477c111c --- /dev/null +++ b/tests/generic/363 @@ -0,0 +1,23 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2024 Red Hat, Inc. All Rights Reserved. +# +# FSQA Test No. 363 +# +# Run fsx with EOF pollution enabled. This provides test coverage for partial +# EOF page/block zeroing for operations that change file size. +# + +. ./common/preamble +_begin_fstest rw auto + +_require_test + +# currently only xfs performs enough zeroing to satisfy fsx +_supported_fs xfs + +# on failure, replace -q with -d to see post-eof writes in the dump output +run_fsx "-q -S 0 -e 1 -N 100000" + +status=0 +exit diff --git a/tests/generic/363.out b/tests/generic/363.out new file mode 100644 index 00000000..3d219cd0 --- /dev/null +++ b/tests/generic/363.out @@ -0,0 +1,2 @@ +QA output created by 363 +fsx -q -S 0 -e 1 -N 100000
Filesystem regressions related to partial page zeroing can go unnoticed for a decent amount of time. A recent example is the issue of iomap zero range not handling dirty pagecache over unwritten extents, which leads to wrong behavior on certain file extending operations (i.e. truncate, write extension, etc.). fsx does occasionally uncover these sorts of problems, but failures can be rare and/or require longer running tests outside what is typically run via full fstests regression runs. fsx now supports a mode that injects post-eof data in order to explicitly test partial eof zeroing behavior. This uncovers certain problems more quickly and applies coverage more broadly across size changing operations. Add a new test that runs an fsx instance (modeled after generic/127) with eof pollution mode enabled. While the test is generic, it is currently limited to XFS as that is currently the only known major fs that does enough zeroing to satisfy the strict semantics expected by fsx. The long term goal is to uncover and fix issues so more filesystems can enable this test. Signed-off-by: Brian Foster <bfoster@redhat.com> --- tests/generic/363 | 23 +++++++++++++++++++++++ tests/generic/363.out | 2 ++ 2 files changed, 25 insertions(+) create mode 100755 tests/generic/363 create mode 100644 tests/generic/363.out