re-enable tests that require scratch dev on NFS
Subsystems (2)
cover re-enable tests that require scratch dev on NFS
This commit disables tests requires scratch dev running on NFS
c041421 xfstests: stop special casing nfs and udf
Now re-enable them to get a larger test coverage on NFS.
Also do more updates to avoid unnecessary failures on NFS.
I tested against NFSv3 NFSv4.0 NFSv4.1 (both linux server and client, with 3.18-rc1 kernel), the results look good.
Failures on NFSv3:
generic/035 generic/089 generic/258 generic/294
Failures on NFSv4.0:
generic/035 generic/169 generic/294
Failures on NFSv4.1:
I hit kernel BUG_ON when testing on NFSv4.1 in generic/285 SEEK_DATA/SEEK_HOLE test. I think there's already a patch to fix it.
http://www.spinics.net/lists/linux-nfs/msg47359.html
Note that generic/294 does remount,ro on SCRATCH_DEV, but TEST_DEV is affected too, so some tests after generic/294 fail because of EROFS. Run the failed tests seperately and they all passed.
I'm not sure if it's a bug, but I filed one, please see
https://bugzilla.redhat.com/show_bug.cgi?id=1158046
Thanks,
Eryu
---
Eryu Guan (4):
common: re-enable tests that require scratch dev on NFS
common: add _require_block_device() helper
common: skip atime related tests on NFS generic/277: add _require_attrs
common/rc | 40 ++++++++++++++++++++++++++++++++++++---- tests/generic/003 | 1 + tests/generic/076 | 1 + tests/generic/192 | 1 + tests/generic/277 | 2 ++ 5 files changed, 41 insertions(+), 4 deletions(-)
Signature · 1 line
1.8.3.1
PATCH 1/4 common: re-enable tests that require scratch dev on NFS
This commit disables tests requires scratch dev running on NFS
c041421 xfstests: stop special casing nfs and udf
Now re-enable them to get a larger test coverage on NFS.
--- common/rc | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-)
common/rc +13 -3
@@ -558,7 +558,11 @@ _scratch_mkfs() _scratch_mkfs_xfs $* ;; nfs*) - # do nothing for nfs + # unable to re-create NFS, just remove all files in $SCRATCH_MNT to + # avoid EEXIST caused by the leftover files created in previous runs + _scratch_mount + rm -rf $SCRATCH_MNT/* + _scratch_unmount ;; cifs) # do nothing for cifs
@@ -1032,8 +1036,14 @@ _require_scratch_nocheck() { case "$FSTYP" in nfs*) - _notrun "requires a scratch device" - ;; + echo $SCRATCH_DEV | grep -q ":/" > /dev/null 2>&1 + if [ -z "$SCRATCH_DEV" -o "$?" != "0" ]; then + _notrun "this test requires a valid \$SCRATCH_DEV" + fi + if [ ! -d "$SCRATCH_MNT" ]; then + _notrun "this test requires a valid \$SCRATCH_MNT" + fi + ;; cifs) _notrun "requires a scratch device" ;;
Signature · 1 line
1.8.3.1
PATCH 2/4 common: add _require_block_device() helper
In reply to Eryu GuanAdd _require_block_device() helper and use it in _require_dm_flakey() and generic/076.
_require_dm_flakey() assumes $SCRATCH_DEV is a block device, now it can also be a NFS export.
generic/076 does "cat $SCRATCH_DEV" which will fail when testing on NFS.
--- common/rc | 15 +++++++++++++++ tests/generic/076 | 1 + 2 files changed, 16 insertions(+)
common/rc +15 -0
@@ -1237,10 +1237,25 @@ _require_command() [ -n "$1" -a -x "$1" ] || _notrun "$_cmd utility required, skipped this test" } +# this test requires the device to be valid block device +# $1 - device +_require_block_device() +{ + if [ -z "$1" ]; then + echo "Usage: _require_block_device <dev>" 1>&2 + exit 1 + fi + if [ "`_is_block_dev $SCRATCH_DEV`" == "" ]; then + _notrun "require $1 to be valid block disk" + fi +} + # this test requires the device mapper flakey target # _require_dm_flakey() { + # require SCRATCH_DEV to be a valid block device + _require_block_device $SCRATCH_DEV _require_command $DMSETUP_PROG modprobe dm-flakey >/dev/null 2>&1
tests/generic/076 +1 -0
@@ -56,6 +56,7 @@ _supported_fs generic _supported_os IRIX Linux _require_scratch +_require_block_device $SCRATCH_DEV echo "*** init fs"
Signature · 1 line
1.8.3.1
PATCH 3/4 common: skip atime related tests on NFS
In reply to Eryu GuanQuoted 1 line
From nfs(5) we can know that atime related mount options have no effect
on NFS mounts, so add _require_atime() helper to skip atime tests on NFS
Also change the way how _require_relatime() mount $SCRATCH_DEV, use _scratch_mount helper so it's mounted with selinux context, to avoid "same superblock, different selinux context" failure.
--- common/rc | 9 ++++++++- tests/generic/003 | 1 + tests/generic/192 | 1 + 3 files changed, 10 insertions(+), 1 deletion(-)
common/rc +8 -1
@@ -2379,10 +2379,17 @@ _verify_reflink() || echo "$1 and $2 are not reflinks: different extents" } +_require_atime() +{ + if [ "$FSTYP" == "nfs" ]; then + _notrun "atime related mount options have no effect on NFS" + fi +} + _require_relatime() { _scratch_mkfs > /dev/null 2>&1 - _mount -t $FSTYP -o relatime $SCRATCH_DEV $SCRATCH_MNT || \ + _scratch_mount -o relatime || \ _notrun "relatime not supported by the current kernel" _scratch_unmount }
tests/generic/003 +1 -0
@@ -47,6 +47,7 @@ _cleanup() _supported_fs generic _supported_os Linux _require_scratch +_require_atime _require_relatime rm -f $seqres.full
tests/generic/192 +1 -0
@@ -54,6 +54,7 @@ is_noatime_set() { _supported_fs generic _supported_os Linux _require_test +_require_atime #delay=150 #delay=75 #delay=60
Signature · 1 line
1.8.3.1
PATCH 4/4 generic/277: add _require_attrs
In reply to Eryu GuanNFS doesn't support attr yet, add _require_attrs in generic/277 to avoid failure when testing on NFS.
--- tests/generic/277 | 2 ++ 1 file changed, 2 insertions(+)
tests/generic/277 +2 -0
@@ -38,11 +38,13 @@ trap "_cleanup ; exit \$status" 0 1 2 3 15 # get standard environment, filters and checks . ./common/rc . ./common/filter +. ./common/attr # real QA test starts here _supported_fs generic _supported_os Linux _require_scratch +_require_attrs _scratch_mkfs > /dev/null 2>&1 _scratch_mount
Signature · 1 line
1.8.3.1
Re: [PATCH 1/4] common: re-enable tests that require scratch dev on NFS
In reply to Eryu Guancommon/rc _scratch_mkfs() · line 565
Quoted 13 lines · Eryu Guan
index 747cf72..8738da7 100644
common/rc +5
-1@@ -558,7 +558,11 @@ _scratch_mkfs() _scratch_mkfs_xfs $* ;; nfs*) - # do nothing for nfs + # unable to re-create NFS, just remove all files in $SCRATCH_MNT to + # avoid EEXIST caused by the leftover files created in previous runs + _scratch_mount + rm -rf $SCRATCH_MNT/* + _scratch_unmount
Please move this into a helper, and wire it up for cifs as well.
Re: [PATCH 4/4] generic/277: add _require_attrs
In reply to Eryu GuanQuoted 2 lines · Eryu Guan
NFS doesn't support attr yet, add
_require_attrsin generic/277 to avoid failure when testing on NFS.
Looks good,
Re: [PATCH 2/4] common: add _require_block_device() helper
In reply to Eryu GuanQuoted 7 lines · Eryu Guan
Add
_require_block_device()helper and use it in_require_dm_flakey()and generic/076.
_require_dm_flakey()assumes $SCRATCH_DEV is a block device, now it can also be a NFS export.generic/076 does "cat $SCRATCH_DEV" which will fail when testing on NFS.
Looks good,
Re: [PATCH 1/4] common: re-enable tests that require scratch dev on NFS
In reply to Christoph HellwigQuoted 17 lines · Christoph Hellwig
common/rc _scratch_mkfs() · line 565
Quoted 13 lines · Eryu Guan
index 747cf72..8738da7 100644
common/rc +5
-1@@ -558,7 +558,11 @@ _scratch_mkfs() _scratch_mkfs_xfs $* ;; nfs*) - # do nothing for nfs + # unable to re-create NFS, just remove all files in $SCRATCH_MNT to + # avoid EEXIST caused by the leftover files created in previous runs + _scratch_mount + rm -rf $SCRATCH_MNT/* + _scratch_unmountPlease move this into a helper, and wire it up for cifs as well.
Will do in v2.
Thanks for the review!
Eryu
nfs atime semantics, was: Re: [PATCH 3/4] common: skip atime related tests on NFS
In reply to Eryu GuanQuoted 2 lines · Eryu Guan
Quoted 1 line
From nfs(5) we can know that atime related mount options have no effect
on NFS mounts, so add
_require_atime()helper to skip atime tests on NFS
I' like to use this opportunity to start a discussion on NFS atime handlign again, which I think is broken. I think relatime is perfectly fine default semantics for NFS, and not supporting it can cause all kidns of application breakage. Supporting normal atime semantics when explicity requested is also something NFS shouldn't sneak out of.
Quoted 3 lines
Also change the way how
_require_relatime()mount $SCRATCH_DEV, use_scratch_mounthelper so it's mounted with selinux context, to avoid "same superblock, different selinux context" failure.
Can you please split this part into a separate patch?
Re: nfs atime semantics, was: Re: [PATCH 3/4] common: skip atime related tests on NFS
Quoted 10 lines · Christoph Hellwig
Quoted 2 lines · Eryu Guan
Quoted 1 line
From nfs(5) we can know that atime related mount options have no effect
on NFS mounts, so add
_require_atime()helper to skip atime tests on NFSI' like to use this opportunity to start a discussion on NFS atime handlign again, which I think is broken. I think relatime is perfectly fine default semantics for NFS, and not supporting it can cause all kidns of application breakage. Supporting normal atime semantics when explicity requested is also something NFS shouldn't sneak out of.
Quoted 6 lines
Quoted 3 lines
Also change the way how
_require_relatime()mount $SCRATCH_DEV, use_scratch_mounthelper so it's mounted with selinux context, to avoid "same superblock, different selinux context" failure.Can you please split this part into a separate patch?
Sure, will do in v2.
Thanks,
Eryu
Re: nfs atime semantics, was: Re: [PATCH 3/4] common: skip atime related tests on NFS
In reply to Christoph HellwigQuoted 9 lines · Christoph Hellwig
Quoted 2 lines · Eryu Guan
Quoted 1 line
From nfs(5) we can know that atime related mount options have no effect
on NFS mounts, so add
_require_atime()helper to skip atime tests on NFSI' like to use this opportunity to start a discussion on NFS atime handlign again, which I think is broken. I think relatime is perfectly fine default semantics for NFS, and not supporting it can cause all kidns of application breakage. Supporting normal atime semantics when explicity requested is also something NFS shouldn't sneak out of.
If there is no read on the wire, then there is no way to update the atime without doing an explicit SETATTR. Courtesy of POSIX filesystem semantics on the server, that means we get a bonus change attribute and ctime update (no extra charge).
Unless there are new suggestions for how to solve the atime issue that do not involve introducing this or similar regressions, then the standing NACK applies.
Cheers
Trond
Signature · 5 lines
Trond Myklebust Linux NFS client maintainer, PrimaryData [email protected]
Re: nfs atime semantics, was: Re: [PATCH 3/4] common: skip atime related tests on NFS
On 10/31/2014 01:31 PM, Trond Myklebust wrote:
<>
Quoted 9 lines
If there is no read on the wire, then there is no way to update the atime without doing an explicit SETATTR. Courtesy of POSIX filesystem semantics on the server, that means we get a bonus change attribute and ctime update (no extra charge).
Unless there are new suggestions for how to solve the atime issue that do not involve introducing this or similar regressions, then the standing NACK applies.
Say the user asks, realy (realy^3) nicely, can we instead of sending SETATTR (BAD) send in its place an async READ of say one byte (or one word)
It will do what we want. Just need to collect the updates and atime vs rel-atime correctly, and to not hurt performance as well. (Like only send when no real READS went through)
Quoted 3 lines
Cheers
Trond
Cheers
Boaz
Re: nfs atime semantics, was: Re: [PATCH 3/4] common: skip atime related tests on NFS
In reply to Trond MyklebustQuoted 8 lines · Trond Myklebust
If there is no read on the wire, then there is no way to update the atime without doing an explicit SETATTR. Courtesy of POSIX filesystem semantics on the server, that means we get a bonus change attribute and ctime update (no extra charge).
Unless there are new suggestions for how to solve the atime issue that do not involve introducing this or similar regressions, then the standing NACK applies.
I think various network filesystems are fairly lax on updating the atime on the server. What xfstests generic/192 tests is that we don't lose an atime update after an unmount/remount. I think we should be able to expect local atime updates, and updates to the server on unmount.
Or at least claim that the filesystem is mounted by noatime if it is so that users (including xfstests) notice, and can enable strict atime mode if really needed, including the above mentioned drawbacks.