Skip to contentSkip to conversation

re-enable tests that require scratch dev on NFS

RFC PATCH Superseded Eryu Guan 4 participants 14 messages Oct 28, 2014 – Nov 5, 2014

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Eryu Guan

author
#0 lore raw

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
author
#1 lore raw

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
index 747cf72..8738da7 100644
@@ -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
#2 lore raw

Re: [PATCH 1/4] common: re-enable tests that require scratch dev on NFS

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_unmount

Please move this into a helper, and wire it up for cifs as well.

author
#3 lore raw

Re: [PATCH 1/4] common: re-enable tests that require scratch dev on NFS

Quoted 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_unmount

Please move this into a helper, and wire it up for cifs as well.

Will do in v2.

Thanks for the review!

Eryu

author
#4 lore raw

PATCH 2/4 common: add _require_block_device() helper

In reply to 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.

---
 common/rc         | 15 +++++++++++++++
 tests/generic/076 |  1 +
 2 files changed, 16 insertions(+)
common/rc +15 -0
index 8738da7..42f00cb 100644
@@ -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
index 02af762..aa0aae0 100755
@@ -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
Reviewed-by on v1 2/4
#5 lore raw

Re: [PATCH 2/4] common: add _require_block_device() helper

Quoted 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,

author
#6 lore raw

PATCH 3/4 common: skip atime related tests on NFS

In reply to 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

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
index 42f00cb..b50577f 100644
@@ -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
index 83d6f90..7ffd09a 100755
@@ -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
index b2da358..5b6cfbc 100755
@@ -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
#7 lore raw

nfs atime semantics, was: Re: [PATCH 3/4] common: skip atime related tests on NFS

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 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_mount helper 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?

author
#8 lore raw

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 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 6 lines
Quoted 3 lines

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.

Can you please split this part into a separate patch?

Sure, will do in v2.

Thanks,
Eryu

#9 lore raw

Re: nfs atime semantics, was: Re: [PATCH 3/4] common: skip atime related tests on NFS

In reply to Christoph Hellwig
Quoted 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 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.

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]
#10 lore raw

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

#11 lore raw

Re: nfs atime semantics, was: Re: [PATCH 3/4] common: skip atime related tests on NFS

In reply to Trond Myklebust
Quoted 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.

author
#12 lore raw

PATCH 4/4 generic/277: add _require_attrs

In reply to Eryu Guan

NFS 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
index 8461ad9..39ebdc3 100755
@@ -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