]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
common/rc: only force nfs4.2 non-default SEEK_HOLE behaviour
authorJeffle Xu <jefflexu@linux.alibaba.com>
Thu, 29 Jul 2021 04:47:58 +0000 (12:47 +0800)
committerEryu Guan <guaneryu@gmail.com>
Sun, 8 Aug 2021 12:14:35 +0000 (20:14 +0800)
Only NFSv4.2 supports non-defautl SEEK_HOLE behaviour. Thus default
SEEK_HOLE behaviour shall be allowed for NFSv4.0/4.1, or it will fail
generic/285, generic/448, generic/490 on NFSv4.0/4.1, complaining they
should support non-default SEEK_HOLE behaviour.

The *.full log is like:
File system supports the default behavior.
Default behavior is not allowed. Aborting.

Signed-off-by: Jeffle Xu <jefflexu@linux.alibaba.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
common/rc

index d4b1f21f64c1eb0500d94cc6513bc9824ab5dfd9..e04d9365d9027752571a78c57940fdfe4146e46f 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -2655,10 +2655,10 @@ _fstyp_has_non_default_seek_data_hole()
                return 0
                ;;
        nfs*)
-               # NFSv2 and NFSv3 only support default behavior of SEEK_HOLE,
-               # while NFSv4 supports non-default behavior
-               local nfsvers=`_df_device $TEST_DEV | $AWK_PROG '{ print $2 }'`
-               [ "$nfsvers" = "nfs4" ]
+               # NFSv2, NFSv3, and NFSv4.0/4.1 only support default behavior of SEEK_HOLE,
+               # while NFSv4.2 supports non-default behavior
+               local nfsvers=`_mount() | grep $TEST_DEV | sed -n 's/^.*vers=\([0-9.]*\).*$/\1/p'`
+               [ "$nfsvers" = "4.2" ]
                return $?
                ;;
        overlay)