public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/1] nfslock01.sh: Don't test on NFS v3 on TCP
@ 2023-05-02  7:59 Petr Vorel
  2023-05-02  9:22 ` Petr Vorel
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Petr Vorel @ 2023-05-02  7:59 UTC (permalink / raw)
  To: ltp; +Cc: NeilBrown, linux-nfs

nfs_flock (run via nfslock01.sh) is known to fail on NFS v3 [1]:

    not unsharing /var makes AF_UNIX socket for host's rpcbind to become
    available inside ltp_ns. Then, at NFS v3 mount time, kernel creates
    an instance of lockd for ltp_ns, and ports for that instance leak to
    host's rpcbind and overwrite ports for lockd already active for root
    namespace. This breaks nfs3 file locking.

Before bd512e733 ("nfs_flock: fail the test if lock/unlock ops fail")
it run indefinitely with "unhandled error -107":
[ 2840.099565] lockd: cannot monitor 10.0.0.2
[ 2840.109353] lockd: cannot monitor 10.0.0.2
[ 2843.286811] xs_tcp_setup_socket: connect returned unhandled error -107
[ 2850.198791] xs_tcp_setup_socket: connect returned unhandled error -107

bd512e733 caused an early abort (therefore only "cannot monitor 10.0.0.2"
appears).

Although there is suggestion, how to fix the problem in kernel [2]:

    > Maybe rpcb_create_local() shall detect that it is not in root
    > netns, and only try AF_INET connection to > localhost in that case.

    That would be simple and might be sensible.  IF changing the AF_UNIX
    path to "/run/rpcbind.sock" isn't sufficient, then testing for the
    root_ns is probably the best second option.

Until it's implemented, it's better to:
* don't test on NFS v3 on both TCP and UDP (remove from the runtest file)
* skip the test with TCONF in case version 3 is passed on command line

NOTE: Tested only on TCP (UDP is disabled in kernel by default via
NFS_DISABLE_UDP_SUPPORT).

[1] https://lore.kernel.org/ltp/YebcNQg0u5cU1QyQ@pevik/
[2] https://lore.kernel.org/ltp/164254401568.24166.883582030601071761@noble.neil.brown.name/

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 runtest/net.nfs                              | 4 ----
 testcases/network/nfs/nfslock01/nfslock01.sh | 6 ++++++
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/runtest/net.nfs b/runtest/net.nfs
index 72cf4b307..a73956015 100644
--- a/runtest/net.nfs
+++ b/runtest/net.nfs
@@ -83,13 +83,9 @@ nfs4_ipv6_08 nfs08.sh -6 -v 4 -t tcp
 nfs41_ipv6_08 nfs08.sh -6 -v 4.1 -t tcp
 nfs42_ipv6_08 nfs08.sh -6 -v 4.2 -t tcp
 
-nfslock3_01 nfslock01.sh -v 3 -t udp
-nfslock3t_01 nfslock01.sh -v 3 -t tcp
 nfslock4_01 nfslock01.sh -v 4 -t tcp
 nfslock41_01 nfslock01.sh -v 4.1 -t tcp
 nfslock42_01 nfslock01.sh -v 4.2 -t tcp
-nfslock3_ipv6_01 nfslock01.sh -6 -v 3 -t udp
-nfslock3t_ipv6_01 nfslock01.sh -6 -v 3 -t tcp
 nfslock4_ipv6_01 nfslock01.sh -6 -v 4 -t tcp
 nfslock41_ipv6_01 nfslock01.sh -6 -v 4.1 -t tcp
 nfslock42_ipv6_01 nfslock01.sh -6 -v 4.2 -t tcp
diff --git a/testcases/network/nfs/nfslock01/nfslock01.sh b/testcases/network/nfs/nfslock01/nfslock01.sh
index fbcc3c00f..78904281b 100755
--- a/testcases/network/nfs/nfslock01/nfslock01.sh
+++ b/testcases/network/nfs/nfslock01/nfslock01.sh
@@ -15,6 +15,12 @@ TST_TESTFUNC="do_test"
 
 do_setup()
 {
+	local i
+
+	for i in $VERSION; do
+		[ "$v" = 3 ] && tst_brk TCONF "Test is known to fail on NFSv3"
+	done
+
 	nfs_setup
 
 	tst_res TINFO "creating test files"
-- 
2.40.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-05-10  2:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-02  7:59 [LTP] [PATCH 1/1] nfslock01.sh: Don't test on NFS v3 on TCP Petr Vorel
2023-05-02  9:22 ` Petr Vorel
2023-05-02 12:25 ` Jeff Layton
2023-05-02 13:41   ` Petr Vorel
2023-05-08  2:50     ` Nikita Yushchenko
2023-05-09 23:00       ` NeilBrown
2023-05-10  2:44         ` Nikita Yushchenko
2023-05-02 21:21   ` NeilBrown
2023-05-04 20:37 ` Petr Vorel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox