* [PATCH v3 0/3] Fix/harden "quick" tests for realtime subvolumes
@ 2018-01-11 3:08 Richard Wareing
2018-01-11 3:08 ` [PATCH v3 1/3] xfs/realtime: Add require_no_realtime function Richard Wareing
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Richard Wareing @ 2018-01-11 3:08 UTC (permalink / raw)
To: fstests; +Cc: darrick.wong, eguan, linux-xfs
Applies clean to commit 95c924c65113d2b706436d8cd09cd391eddb795a.
Kernel: 4.14-rc8 (Commit 39dae59d66acd86d1de24294bd2f343fd5e7a625)
MKFS_OPTIONS="-m finobt=1,crc=1,reflink=1"
Updated patch set to address comments made by reviewers. Changes are noted
on the patches.
A couple of tests (e.g. tests/xfs/191-input-validation) which work for Eryu
still fail for me, but I'll comment on those w/ sample output on the mailing
list, as I might have some toolchain issue on my end.
==== Original Cover Letter ===
Some tests have issues when being run with realtime subvolumes. This patch
set aims to harden fs tests so we can get reliable/reproducible test runs
with fstests for realtime subvolumes.
Two new _require functions are introduced along with a new flag to
automatically set the rtinherit=1 option upon mkfs'ing.
The problems I found were usually one of:
1. Snapshot + subsequent test being performed without regard to the realtime
subvolume.
2. Use of functions which are not supported by realtime devices. Not setting
rtinherit on scratch devices for these cases fixes these tests. Non-scratch
cases are more tricky since we don't control what goes into the MKFS_OPTIONS
variable.
3. xfs_repair being used directly without checking for RT devices.
After fixing these cases, you get 86 good "quick: xfs tests & 180 good "quick"
generic tests with the bulk are not run due to the lack of reflink and/or quota
support on realtime scratch targets.
P.S I haven't forgotten about the non-"quick" tests, but I had to start
somewhere, and break this up a bit into a more manageable problem.
Richard Wareing (3):
xfs/realtime: Add require_no_realtime function
xfs/realtime: Default rtinherit=1, add _require_no_rtinherit function
xfs/realtime: Fix direct invocations of xfs_repair
common/rc | 29 +++++++++++++++++++++++++++--
tests/generic/250 | 3 +++
tests/generic/252 | 3 +++
tests/generic/441 | 3 +++
tests/xfs/070 | 5 ++++-
tests/xfs/077 | 2 ++
tests/xfs/170 | 1 +
tests/xfs/189 | 1 +
tests/xfs/284 | 2 ++
tests/xfs/291 | 5 ++++-
10 files changed, 50 insertions(+), 4 deletions(-)
--
2.9.5
^ permalink raw reply [flat|nested] 8+ messages in thread* [PATCH v3 1/3] xfs/realtime: Add require_no_realtime function 2018-01-11 3:08 [PATCH v3 0/3] Fix/harden "quick" tests for realtime subvolumes Richard Wareing @ 2018-01-11 3:08 ` Richard Wareing 2018-01-11 4:10 ` Darrick J. Wong 2018-01-11 3:09 ` [PATCH v3 2/3] xfs/realtime: Default rtinherit=1, add _require_no_rtinherit function Richard Wareing 2018-01-11 3:09 ` [PATCH v3 3/3] xfs/realtime: Fix direct invocations of xfs_repair Richard Wareing 2 siblings, 1 reply; 8+ messages in thread From: Richard Wareing @ 2018-01-11 3:08 UTC (permalink / raw) To: fstests; +Cc: darrick.wong, eguan, linux-xfs Some tests do not play well with realtime devices, in an effort to produce a stable set of test which exercise the realtime code paths we introduce a _require_no_realtime function to allow tests to opt out of realtime subvolume test runs. Signed-off-by: Richard Wareing <rwareing@fb.com> --- Changes since v2: * Fixed tests generic/409-411, _get_mount now honors $SCRATCH_OPTIONS * tests/xfs/202 reverted, the test does indeed work with larger test device * Added comments explaining why _require_no_realtime was declared Changes since v1: * None common/rc | 18 ++++++++++++++++-- tests/xfs/077 | 2 ++ tests/xfs/189 | 1 + tests/xfs/284 | 2 ++ 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/common/rc b/common/rc index 9216efd..f5fe739 100644 --- a/common/rc +++ b/common/rc @@ -198,8 +198,14 @@ _mount() _get_mount() { local mnt_point=${!#} + local mnt_dev=${@:(-2):1} + local scratch_opts="" + if [ "$mnt_dev" == "$SCRATCH_DEV" ]; then + _scratch_options mount + scratch_opts="$SCRATCH_OPTIONS" + fi - _mount $* + _mount $scratch_opts $* if [ $? -eq 0 ]; then MOUNTED_POINT_STACK="$mnt_point $MOUNTED_POINT_STACK" else @@ -230,7 +236,7 @@ _clear_mount_stack() _scratch_options() { - type=$1 + local type=$1 SCRATCH_OPTIONS="" if [ "$FSTYP" != "xfs" ]; then @@ -1737,6 +1743,14 @@ _require_realtime() _notrun "Realtime device required, skipped this test" } +# This test requires that a realtime subvolume is not in use +# +_require_no_realtime() +{ + [ -n "$SCRATCH_RTDEV" ] && \ + _notrun "Test not compatible with realtime subvolumes, skipped this test" +} + # this test requires that a specified command (executable) exists # $1 - command, $2 - name for error message # diff --git a/tests/xfs/077 b/tests/xfs/077 index eba4f08..6d5ac1a 100755 --- a/tests/xfs/077 +++ b/tests/xfs/077 @@ -50,6 +50,8 @@ _cleanup() _supported_fs xfs _supported_os Linux +# xfs_copy does not support realtime devices +_require_no_realtime _require_scratch _require_xfs_crc _require_meta_uuid diff --git a/tests/xfs/189 b/tests/xfs/189 index 636f6f0..699eb3c 100755 --- a/tests/xfs/189 +++ b/tests/xfs/189 @@ -236,6 +236,7 @@ _putback_scratch_fstab() _supported_fs xfs _supported_os Linux +_require_no_realtime _require_scratch _require_noattr2 diff --git a/tests/xfs/284 b/tests/xfs/284 index e3625fe..d0eb5bd 100755 --- a/tests/xfs/284 +++ b/tests/xfs/284 @@ -49,6 +49,8 @@ rm -f $seqres.full # real QA test starts here _supported_fs xfs _supported_os Linux +# xfs_copy does not support realtime devices +_require_no_realtime _require_test _require_scratch -- 2.9.5 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v3 1/3] xfs/realtime: Add require_no_realtime function 2018-01-11 3:08 ` [PATCH v3 1/3] xfs/realtime: Add require_no_realtime function Richard Wareing @ 2018-01-11 4:10 ` Darrick J. Wong 2018-01-11 21:22 ` Richard Wareing 0 siblings, 1 reply; 8+ messages in thread From: Darrick J. Wong @ 2018-01-11 4:10 UTC (permalink / raw) To: Richard Wareing; +Cc: fstests, eguan, linux-xfs On Wed, Jan 10, 2018 at 07:08:59PM -0800, Richard Wareing wrote: > Some tests do not play well with realtime devices, in an effort to > produce a stable set of test which exercise the realtime code paths > we introduce a _require_no_realtime function to allow tests to opt > out of realtime subvolume test runs. > > Signed-off-by: Richard Wareing <rwareing@fb.com> > --- > Changes since v2: > * Fixed tests generic/409-411, _get_mount now honors $SCRATCH_OPTIONS > * tests/xfs/202 reverted, the test does indeed work with larger test > device > * Added comments explaining why _require_no_realtime was declared > > Changes since v1: > * None > > common/rc | 18 ++++++++++++++++-- > tests/xfs/077 | 2 ++ > tests/xfs/189 | 1 + > tests/xfs/284 | 2 ++ > 4 files changed, 21 insertions(+), 2 deletions(-) > > diff --git a/common/rc b/common/rc > index 9216efd..f5fe739 100644 > --- a/common/rc > +++ b/common/rc > @@ -198,8 +198,14 @@ _mount() > _get_mount() > { > local mnt_point=${!#} > + local mnt_dev=${@:(-2):1} > + local scratch_opts="" tab/space indentation problem? > + if [ "$mnt_dev" == "$SCRATCH_DEV" ]; then "=" for comparison, not "==" (it's bashism, though we probably don't care...?) > + _scratch_options mount > + scratch_opts="$SCRATCH_OPTIONS" > + fi > > - _mount $* > + _mount $scratch_opts $* > if [ $? -eq 0 ]; then > MOUNTED_POINT_STACK="$mnt_point $MOUNTED_POINT_STACK" > else > @@ -230,7 +236,7 @@ _clear_mount_stack() > > _scratch_options() > { > - type=$1 > + local type=$1 > SCRATCH_OPTIONS="" > > if [ "$FSTYP" != "xfs" ]; then > @@ -1737,6 +1743,14 @@ _require_realtime() > _notrun "Realtime device required, skipped this test" > } > > +# This test requires that a realtime subvolume is not in use > +# > +_require_no_realtime() > +{ > + [ -n "$SCRATCH_RTDEV" ] && \ > + _notrun "Test not compatible with realtime subvolumes, skipped this test" Do we have to check USE_EXTERNAL = yes here too? > +} > + > # this test requires that a specified command (executable) exists > # $1 - command, $2 - name for error message > # > diff --git a/tests/xfs/077 b/tests/xfs/077 > index eba4f08..6d5ac1a 100755 > --- a/tests/xfs/077 > +++ b/tests/xfs/077 > @@ -50,6 +50,8 @@ _cleanup() > > _supported_fs xfs > _supported_os Linux > +# xfs_copy does not support realtime devices This seems like more of a bug in xfs_copy to me... :) --D > +_require_no_realtime > _require_scratch > _require_xfs_crc > _require_meta_uuid > diff --git a/tests/xfs/189 b/tests/xfs/189 > index 636f6f0..699eb3c 100755 > --- a/tests/xfs/189 > +++ b/tests/xfs/189 > @@ -236,6 +236,7 @@ _putback_scratch_fstab() > _supported_fs xfs > _supported_os Linux > > +_require_no_realtime > _require_scratch > _require_noattr2 > > diff --git a/tests/xfs/284 b/tests/xfs/284 > index e3625fe..d0eb5bd 100755 > --- a/tests/xfs/284 > +++ b/tests/xfs/284 > @@ -49,6 +49,8 @@ rm -f $seqres.full > # real QA test starts here > _supported_fs xfs > _supported_os Linux > +# xfs_copy does not support realtime devices > +_require_no_realtime > _require_test > _require_scratch > > -- > 2.9.5 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-xfs" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v3 1/3] xfs/realtime: Add require_no_realtime function 2018-01-11 4:10 ` Darrick J. Wong @ 2018-01-11 21:22 ` Richard Wareing 0 siblings, 0 replies; 8+ messages in thread From: Richard Wareing @ 2018-01-11 21:22 UTC (permalink / raw) To: Darrick J. Wong; +Cc: fstests, Eryu Guan, linux-xfs Darrick J. Wong <darrick.wong@oracle.com> wrote: > On Wed, Jan 10, 2018 at 07:08:59PM -0800, Richard Wareing wrote: >> Some tests do not play well with realtime devices, in an effort to >> produce a stable set of test which exercise the realtime code paths >> we introduce a _require_no_realtime function to allow tests to opt >> out of realtime subvolume test runs. >> >> Signed-off-by: Richard Wareing <rwareing@fb.com> >> --- >> Changes since v2: >> * Fixed tests generic/409-411, _get_mount now honors $SCRATCH_OPTIONS >> * tests/xfs/202 reverted, the test does indeed work with larger test >> device >> * Added comments explaining why _require_no_realtime was declared >> >> Changes since v1: >> * None >> >> common/rc | 18 ++++++++++++++++-- >> tests/xfs/077 | 2 ++ >> tests/xfs/189 | 1 + >> tests/xfs/284 | 2 ++ >> 4 files changed, 21 insertions(+), 2 deletions(-) >> >> diff --git a/common/rc b/common/rc >> index 9216efd..f5fe739 100644 >> --- a/common/rc >> +++ b/common/rc >> @@ -198,8 +198,14 @@ _mount() >> _get_mount() >> { >> local mnt_point=${!#} >> + local mnt_dev=${@:(-2):1} >> + local scratch_opts="" > > tab/space indentation problem? Yup my bad, fixing. > >> + if [ "$mnt_dev" == "$SCRATCH_DEV" ]; then > > "=" for comparison, not "==" (it's bashism, though we probably don't > care...?) > >> + _scratch_options mount >> + scratch_opts="$SCRATCH_OPTIONS" >> + fi >> >> - _mount $* >> + _mount $scratch_opts $* >> if [ $? -eq 0 ]; then >> MOUNTED_POINT_STACK="$mnt_point $MOUNTED_POINT_STACK" >> else >> @@ -230,7 +236,7 @@ _clear_mount_stack() >> >> _scratch_options() >> { >> - type=$1 >> + local type=$1 >> SCRATCH_OPTIONS="" >> >> if [ "$FSTYP" != "xfs" ]; then >> @@ -1737,6 +1743,14 @@ _require_realtime() >> _notrun "Realtime device required, skipped this test" >> } >> >> +# This test requires that a realtime subvolume is not in use >> +# >> +_require_no_realtime() >> +{ >> + [ -n "$SCRATCH_RTDEV" ] && \ >> + _notrun "Test not compatible with realtime subvolumes, skipped this >> test" > > Do we have to check USE_EXTERNAL = yes here too? Ya that's probably fair, I'll fix this. > >> +} >> + >> # this test requires that a specified command (executable) exists >> # $1 - command, $2 - name for error message >> # >> diff --git a/tests/xfs/077 b/tests/xfs/077 >> index eba4f08..6d5ac1a 100755 >> --- a/tests/xfs/077 >> +++ b/tests/xfs/077 >> @@ -50,6 +50,8 @@ _cleanup() >> >> _supported_fs xfs >> _supported_os Linux >> +# xfs_copy does not support realtime devices > > This seems like more of a bug in xfs_copy to me... :) > Agreed, it would be nice to get this fixed. > --D > >> +_require_no_realtime >> _require_scratch >> _require_xfs_crc >> _require_meta_uuid >> diff --git a/tests/xfs/189 b/tests/xfs/189 >> index 636f6f0..699eb3c 100755 >> --- a/tests/xfs/189 >> +++ b/tests/xfs/189 >> @@ -236,6 +236,7 @@ _putback_scratch_fstab() >> _supported_fs xfs >> _supported_os Linux >> >> +_require_no_realtime >> _require_scratch >> _require_noattr2 >> >> diff --git a/tests/xfs/284 b/tests/xfs/284 >> index e3625fe..d0eb5bd 100755 >> --- a/tests/xfs/284 >> +++ b/tests/xfs/284 >> @@ -49,6 +49,8 @@ rm -f $seqres.full >> # real QA test starts here >> _supported_fs xfs >> _supported_os Linux >> +# xfs_copy does not support realtime devices >> +_require_no_realtime >> _require_test >> _require_scratch >> >> -- >> 2.9.5 >> >> -- >> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in >> the body of a message to majordomo@vger.kernel.org >> More majordomo info at http://vger.kernel.org/majordomo-info.html > -- > To unsubscribe from this list: send the line "unsubscribe linux-xfs" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v3 2/3] xfs/realtime: Default rtinherit=1, add _require_no_rtinherit function 2018-01-11 3:08 [PATCH v3 0/3] Fix/harden "quick" tests for realtime subvolumes Richard Wareing 2018-01-11 3:08 ` [PATCH v3 1/3] xfs/realtime: Add require_no_realtime function Richard Wareing @ 2018-01-11 3:09 ` Richard Wareing 2018-01-11 4:06 ` Darrick J. Wong 2018-01-11 3:09 ` [PATCH v3 3/3] xfs/realtime: Fix direct invocations of xfs_repair Richard Wareing 2 siblings, 1 reply; 8+ messages in thread From: Richard Wareing @ 2018-01-11 3:09 UTC (permalink / raw) To: fstests; +Cc: darrick.wong, eguan, linux-xfs To better exercise the data path code of realtime subvolumes, we will set rtinherit=1 during mkfs calls. For tests which this is not desired we introduce a _require_no_rtinherit function to opt out of this behavior. Signed-off-by: Richard Wareing <rwareing@fb.com> --- Changes since v2: * Removed use of RT_INHERT, instead we now simply bail from the test. Users will have to create two separate configs for realtime one with rtinherit=1 in the mkfs options, one without and do separate runs to get full test coverage. * Added comments explaining reasons for _require_no_rtinherit declarations Changes since v1: * None common/rc | 11 +++++++++++ tests/generic/250 | 3 +++ tests/generic/252 | 3 +++ tests/generic/441 | 3 +++ tests/xfs/170 | 1 + 5 files changed, 21 insertions(+) diff --git a/common/rc b/common/rc index f5fe739..1720a72 100644 --- a/common/rc +++ b/common/rc @@ -33,6 +33,17 @@ BC=$(which bc 2> /dev/null) || BC= VALID_TEST_ID="[0-9]\{3\}" VALID_TEST_NAME="$VALID_TEST_ID-\?[[:alnum:]-]*" +# When running tests with a realtime device configured, the realtime inherit +# flag will be set during mkfs via -d rtinherit=1 option. For some tests +# this may render the test invalid (i.e. it uses a function which is not +# supported by the realtime subvolume); to prevent failure these tests may +# disable this behavior by calling _require_no_rtinherit . +_require_no_rtinherit() +{ + echo "$MKFS_OPTIONS" | egrep -q "rtinherit([^=]|=1)" && \ + _notrun "rtinherit mkfs option is not supported by this test." +} + _require_math() { if [ -z "$BC" ]; then diff --git a/tests/generic/250 b/tests/generic/250 index 3c4fe6d..a8fd97e 100755 --- a/tests/generic/250 +++ b/tests/generic/250 @@ -48,6 +48,9 @@ _require_scratch _require_dm_target error _require_xfs_io_command "falloc" _require_odirect +# This test uses "dm" without taking into account the data could be on +# realtime subvolume, thus the test will fail with rtinherit=1 +_require_no_rtinherit rm -f $seqres.full diff --git a/tests/generic/252 b/tests/generic/252 index ffedd56..b506d59 100755 --- a/tests/generic/252 +++ b/tests/generic/252 @@ -47,6 +47,9 @@ _supported_os Linux _require_scratch _require_dm_target error _require_xfs_io_command "falloc" +# This test uses "dm" without taking into account the data could be on +# realtime subvolume, thus the test will fail with rtinherit=1 +_require_no_rtinherit _require_aiodio "aiocp" AIO_TEST="src/aio-dio-regress/aiocp" diff --git a/tests/generic/441 b/tests/generic/441 index 075d877..5fbfece 100755 --- a/tests/generic/441 +++ b/tests/generic/441 @@ -47,6 +47,9 @@ _cleanup() # real QA test starts here _supported_os Linux _require_scratch +# This test uses "dm" without taking into account the data could be on +# realtime subvolume, thus the test will fail with rtinherit=1 +_require_no_rtinherit # Generally, we want to avoid journal errors on the extended testcase. Only # unset the -s flag if we have a logdev diff --git a/tests/xfs/170 b/tests/xfs/170 index c5ae8e4..6deef1b 100755 --- a/tests/xfs/170 +++ b/tests/xfs/170 @@ -50,6 +50,7 @@ _supported_fs xfs _supported_os Linux _require_scratch +_require_no_rtinherit _check_filestreams_support || _notrun "filestreams not available" -- 2.9.5 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v3 2/3] xfs/realtime: Default rtinherit=1, add _require_no_rtinherit function 2018-01-11 3:09 ` [PATCH v3 2/3] xfs/realtime: Default rtinherit=1, add _require_no_rtinherit function Richard Wareing @ 2018-01-11 4:06 ` Darrick J. Wong 2018-01-11 21:27 ` Richard Wareing 0 siblings, 1 reply; 8+ messages in thread From: Darrick J. Wong @ 2018-01-11 4:06 UTC (permalink / raw) To: Richard Wareing; +Cc: fstests, eguan, linux-xfs On Wed, Jan 10, 2018 at 07:09:00PM -0800, Richard Wareing wrote: > To better exercise the data path code of realtime subvolumes, we will > set rtinherit=1 during mkfs calls. For tests which this is not desired > we introduce a _require_no_rtinherit function to opt out of this > behavior. > > Signed-off-by: Richard Wareing <rwareing@fb.com> > --- > Changes since v2: > * Removed use of RT_INHERT, instead we now simply bail from the test. Users > will have to create two separate configs for realtime one with rtinherit=1 > in the mkfs options, one without and do separate runs to get full test > coverage. > * Added comments explaining reasons for _require_no_rtinherit declarations > > Changes since v1: > * None > > common/rc | 11 +++++++++++ > tests/generic/250 | 3 +++ > tests/generic/252 | 3 +++ > tests/generic/441 | 3 +++ > tests/xfs/170 | 1 + > 5 files changed, 21 insertions(+) > > diff --git a/common/rc b/common/rc > index f5fe739..1720a72 100644 > --- a/common/rc > +++ b/common/rc > @@ -33,6 +33,17 @@ BC=$(which bc 2> /dev/null) || BC= > VALID_TEST_ID="[0-9]\{3\}" > VALID_TEST_NAME="$VALID_TEST_ID-\?[[:alnum:]-]*" > > +# When running tests with a realtime device configured, the realtime inherit > +# flag will be set during mkfs via -d rtinherit=1 option. For some tests > +# this may render the test invalid (i.e. it uses a function which is not > +# supported by the realtime subvolume); to prevent failure these tests may > +# disable this behavior by calling _require_no_rtinherit . > +_require_no_rtinherit() > +{ > + echo "$MKFS_OPTIONS" | egrep -q "rtinherit([^=]|=1)" && \ > + _notrun "rtinherit mkfs option is not supported by this test." It's worth checking that FSTYP==xfs since this feature only exists in xfs. --D > +} > + > _require_math() > { > if [ -z "$BC" ]; then > diff --git a/tests/generic/250 b/tests/generic/250 > index 3c4fe6d..a8fd97e 100755 > --- a/tests/generic/250 > +++ b/tests/generic/250 > @@ -48,6 +48,9 @@ _require_scratch > _require_dm_target error > _require_xfs_io_command "falloc" > _require_odirect > +# This test uses "dm" without taking into account the data could be on > +# realtime subvolume, thus the test will fail with rtinherit=1 > +_require_no_rtinherit > > rm -f $seqres.full > > diff --git a/tests/generic/252 b/tests/generic/252 > index ffedd56..b506d59 100755 > --- a/tests/generic/252 > +++ b/tests/generic/252 > @@ -47,6 +47,9 @@ _supported_os Linux > _require_scratch > _require_dm_target error > _require_xfs_io_command "falloc" > +# This test uses "dm" without taking into account the data could be on > +# realtime subvolume, thus the test will fail with rtinherit=1 > +_require_no_rtinherit > _require_aiodio "aiocp" > AIO_TEST="src/aio-dio-regress/aiocp" > > diff --git a/tests/generic/441 b/tests/generic/441 > index 075d877..5fbfece 100755 > --- a/tests/generic/441 > +++ b/tests/generic/441 > @@ -47,6 +47,9 @@ _cleanup() > # real QA test starts here > _supported_os Linux > _require_scratch > +# This test uses "dm" without taking into account the data could be on > +# realtime subvolume, thus the test will fail with rtinherit=1 > +_require_no_rtinherit > > # Generally, we want to avoid journal errors on the extended testcase. Only > # unset the -s flag if we have a logdev > diff --git a/tests/xfs/170 b/tests/xfs/170 > index c5ae8e4..6deef1b 100755 > --- a/tests/xfs/170 > +++ b/tests/xfs/170 > @@ -50,6 +50,7 @@ _supported_fs xfs > _supported_os Linux > > _require_scratch > +_require_no_rtinherit > > _check_filestreams_support || _notrun "filestreams not available" > > -- > 2.9.5 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-xfs" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v3 2/3] xfs/realtime: Default rtinherit=1, add _require_no_rtinherit function 2018-01-11 4:06 ` Darrick J. Wong @ 2018-01-11 21:27 ` Richard Wareing 0 siblings, 0 replies; 8+ messages in thread From: Richard Wareing @ 2018-01-11 21:27 UTC (permalink / raw) To: Darrick J. Wong; +Cc: fstests, eguan, linux-xfs Darrick J. Wong <darrick.wong@oracle.com> wrote: > On Wed, Jan 10, 2018 at 07:09:00PM -0800, Richard Wareing wrote: >> To better exercise the data path code of realtime subvolumes, we will >> set rtinherit=1 during mkfs calls. For tests which this is not desired >> we introduce a _require_no_rtinherit function to opt out of this >> behavior. >> >> Signed-off-by: Richard Wareing <rwareing@fb.com> >> --- >> Changes since v2: >> * Removed use of RT_INHERT, instead we now simply bail from the test. >> Users >> will have to create two separate configs for realtime one with rtinherit=1 >> in the mkfs options, one without and do separate runs to get full test >> coverage. >> * Added comments explaining reasons for _require_no_rtinherit declarations >> >> Changes since v1: >> * None >> >> common/rc | 11 +++++++++++ >> tests/generic/250 | 3 +++ >> tests/generic/252 | 3 +++ >> tests/generic/441 | 3 +++ >> tests/xfs/170 | 1 + >> 5 files changed, 21 insertions(+) >> >> diff --git a/common/rc b/common/rc >> index f5fe739..1720a72 100644 >> --- a/common/rc >> +++ b/common/rc >> @@ -33,6 +33,17 @@ BC=$(which bc 2> /dev/null) || BC= >> VALID_TEST_ID="[0-9]\{3\}" >> VALID_TEST_NAME="$VALID_TEST_ID-\?[[:alnum:]-]*" >> >> +# When running tests with a realtime device configured, the realtime >> inherit >> +# flag will be set during mkfs via -d rtinherit=1 option. For some tests >> +# this may render the test invalid (i.e. it uses a function which is not >> +# supported by the realtime subvolume); to prevent failure these tests >> may >> +# disable this behavior by calling _require_no_rtinherit . >> +_require_no_rtinherit() >> +{ >> + echo "$MKFS_OPTIONS" | egrep -q "rtinherit([^=]|=1)" && \ >> + _notrun "rtinherit mkfs option is not supported by this test." > > It's worth checking that FSTYP==xfs since this feature only exists in xfs. > Not a problem, probably worth doing for clarity too. > --D > >> +} >> + >> _require_math() >> { >> if [ -z "$BC" ]; then >> diff --git a/tests/generic/250 b/tests/generic/250 >> index 3c4fe6d..a8fd97e 100755 >> --- a/tests/generic/250 >> +++ b/tests/generic/250 >> @@ -48,6 +48,9 @@ _require_scratch >> _require_dm_target error >> _require_xfs_io_command "falloc" >> _require_odirect >> +# This test uses "dm" without taking into account the data could be on >> +# realtime subvolume, thus the test will fail with rtinherit=1 >> +_require_no_rtinherit >> >> rm -f $seqres.full >> >> diff --git a/tests/generic/252 b/tests/generic/252 >> index ffedd56..b506d59 100755 >> --- a/tests/generic/252 >> +++ b/tests/generic/252 >> @@ -47,6 +47,9 @@ _supported_os Linux >> _require_scratch >> _require_dm_target error >> _require_xfs_io_command "falloc" >> +# This test uses "dm" without taking into account the data could be on >> +# realtime subvolume, thus the test will fail with rtinherit=1 >> +_require_no_rtinherit >> _require_aiodio "aiocp" >> AIO_TEST="src/aio-dio-regress/aiocp" >> >> diff --git a/tests/generic/441 b/tests/generic/441 >> index 075d877..5fbfece 100755 >> --- a/tests/generic/441 >> +++ b/tests/generic/441 >> @@ -47,6 +47,9 @@ _cleanup() >> # real QA test starts here >> _supported_os Linux >> _require_scratch >> +# This test uses "dm" without taking into account the data could be on >> +# realtime subvolume, thus the test will fail with rtinherit=1 >> +_require_no_rtinherit >> >> # Generally, we want to avoid journal errors on the extended testcase. Only >> # unset the -s flag if we have a logdev >> diff --git a/tests/xfs/170 b/tests/xfs/170 >> index c5ae8e4..6deef1b 100755 >> --- a/tests/xfs/170 >> +++ b/tests/xfs/170 >> @@ -50,6 +50,7 @@ _supported_fs xfs >> _supported_os Linux >> >> _require_scratch >> +_require_no_rtinherit >> >> _check_filestreams_support || _notrun "filestreams not available" >> >> -- >> 2.9.5 >> >> -- >> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in >> the body of a message to majordomo@vger.kernel.org >> More majordomo info at http://vger.kernel.org/majordomo-info.html > -- > To unsubscribe from this list: send the line "unsubscribe linux-xfs" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v3 3/3] xfs/realtime: Fix direct invocations of xfs_repair 2018-01-11 3:08 [PATCH v3 0/3] Fix/harden "quick" tests for realtime subvolumes Richard Wareing 2018-01-11 3:08 ` [PATCH v3 1/3] xfs/realtime: Add require_no_realtime function Richard Wareing 2018-01-11 3:09 ` [PATCH v3 2/3] xfs/realtime: Default rtinherit=1, add _require_no_rtinherit function Richard Wareing @ 2018-01-11 3:09 ` Richard Wareing 2 siblings, 0 replies; 8+ messages in thread From: Richard Wareing @ 2018-01-11 3:09 UTC (permalink / raw) To: fstests; +Cc: darrick.wong, eguan, linux-xfs Fixes direct invocations of xfs_repair to add in -r option if required. Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Richard Wareing <rwareing@fb.com> --- Changes since v2: * Added check for USE_EXTERNAL in tests/xfs/291 & tests/xfs/070 * Call xfs_repair via $XFS_REPAIR_PROG Changes since v1: * Fixed kill -9 in test xfs/070 tests/xfs/070 | 5 ++++- tests/xfs/291 | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/xfs/070 b/tests/xfs/070 index 0ae6eff..0d81977 100755 --- a/tests/xfs/070 +++ b/tests/xfs/070 @@ -56,7 +56,10 @@ _cleanup() _xfs_repair_noscan() { # invoke repair directly so we can kill the process if need be - $XFS_REPAIR_PROG $SCRATCH_DEV 2>&1 | tee -a $seqres.full > $tmp.repair & + [ "$USE_EXTERNAL" = yes ] && [ -n "$SCRATCH_RTDEV" ] && \ + rt_repair_opts="-r $SCRATCH_RTDEV" + $XFS_REPAIR_PROG $rt_repair_opts $SCRATCH_DEV 2>&1 | + tee -a $seqres.full > $tmp.repair & repair_pid=$! # monitor progress for as long as it is running diff --git a/tests/xfs/291 b/tests/xfs/291 index 3f5295c..3788e62 100755 --- a/tests/xfs/291 +++ b/tests/xfs/291 @@ -122,7 +122,10 @@ _xfs_check $SCRATCH_DEV >> $seqres.full 2>&1 || _fail "xfs_check failed" # Can xfs_metadump cope with this monster? _scratch_metadump $tmp.metadump || _fail "xfs_metadump failed" xfs_mdrestore $tmp.metadump $tmp.img || _fail "xfs_mdrestore failed" -xfs_repair -f $tmp.img >> $seqres.full 2>&1 || _fail "xfs_repair of metadump failed" +[ "$USE_EXTERNAL" = yes ] && [ -n "$SCRATCH_RTDEV" ] && \ + rt_repair_opts="-r $SCRATCH_RTDEV" +$XFS_REPAIR_PROG $rt_repair_opts -f $tmp.img >> $seqres.full 2>&1 || \ + _fail "xfs_repair of metadump failed" # Yes it can; success, all done status=0 -- 2.9.5 ^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2018-01-11 21:27 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2018-01-11 3:08 [PATCH v3 0/3] Fix/harden "quick" tests for realtime subvolumes Richard Wareing 2018-01-11 3:08 ` [PATCH v3 1/3] xfs/realtime: Add require_no_realtime function Richard Wareing 2018-01-11 4:10 ` Darrick J. Wong 2018-01-11 21:22 ` Richard Wareing 2018-01-11 3:09 ` [PATCH v3 2/3] xfs/realtime: Default rtinherit=1, add _require_no_rtinherit function Richard Wareing 2018-01-11 4:06 ` Darrick J. Wong 2018-01-11 21:27 ` Richard Wareing 2018-01-11 3:09 ` [PATCH v3 3/3] xfs/realtime: Fix direct invocations of xfs_repair Richard Wareing
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox