NFS: always probe for LOCALIO support asynchronously
authorMike Snitzer <snitzer@kernel.org>
Tue, 13 May 2025 16:08:31 +0000 (12:08 -0400)
committerAnna Schumaker <anna.schumaker@oracle.com>
Wed, 28 May 2025 21:17:13 +0000 (17:17 -0400)
commit1ff4716f420b5a6e6ef095b23bb5db76f46be7fc
treeb16ccbd25ec3df4193d7192497e330c3fa7fe731
parent04a15263662ab864725d8b60407e2dd5ba525514
NFS: always probe for LOCALIO support asynchronously

It was reported that NFS client mounts of AWS Elastic File System
(EFS) volumes is slow, this is because the AWS firewall disallows
LOCALIO (because it doesn't consider the use of NFS_LOCALIO_PROGRAM
valid), see: https://bugzilla.redhat.com/show_bug.cgi?id=2335129

Switch to performing the LOCALIO probe asynchronously to address the
potential for the NFS LOCALIO protocol being disallowed and/or slowed
by the remote server's response.

While at it, fix nfs_local_probe_async() to always take/put a
reference on the nfs_client that is using the LOCALIO protocol.
Also, unexport the nfs_local_probe() symbol and make it private to
fs/nfs/localio.c

This change has the side-effect of initially issuing reads, writes and
commits over the wire via SUNRPC until the LOCALIO probe completes.

Suggested-by: Jeff Layton <jlayton@kernel.org> # to always probe async
Fixes: 76d4cb6345da ("nfs: probe for LOCALIO when v4 client reconnects to server")
Cc: stable@vger.kernel.org # 6.14+
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
fs/nfs/client.c
fs/nfs/flexfilelayout/flexfilelayoutdev.c
fs/nfs/internal.h
fs/nfs/localio.c