]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
NFS: Remove rpcbind cleanup for NFSv4.0 callback
authorChuck Lever <chuck.lever@oracle.com>
Wed, 20 Aug 2025 14:27:27 +0000 (10:27 -0400)
committerAnna Schumaker <anna.schumaker@oracle.com>
Tue, 23 Sep 2025 17:28:19 +0000 (13:28 -0400)
The NFS client's NFSv4.0 callback listeners are created with
SVC_SOCK_ANONYMOUS, therefore svc_setup_socket() does not register
them with the client's rpcbind service.

And, note that nfs_callback_down_net() does not call
svc_rpcb_cleanup() at all when shutting down the callback server.

Even if svc_setup_socket() were to attempt to register or unregister
these sockets, the callback service has vs_hidden set, which shunts
the rpcbind upcalls.

The svc_rpcb_cleanup() error flow was introduced by
commit c946556b8749 ("NFS: move per-net callback thread
initialization to nfs_callback_up_net()"). It doesn't appear in the
code that was relocated by that commit.

Therefore, there is no need to call svc_rpcb_cleanup() when listener
creation fails during callback server start-up.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
fs/nfs/callback.c

index 86bdc7d23fb9072623d6c57daf34f2b2e67a55ce..511f80878809c4cffeb575343cb35b496b38b9dc 100644 (file)
@@ -153,7 +153,7 @@ static int nfs_callback_up_net(int minorversion, struct svc_serv *serv,
        ret = svc_bind(serv, net);
        if (ret < 0) {
                printk(KERN_WARNING "NFS: bind callback service failed\n");
-               goto err_bind;
+               goto err;
        }
 
        ret = 0;
@@ -166,13 +166,11 @@ static int nfs_callback_up_net(int minorversion, struct svc_serv *serv,
 
        if (ret < 0) {
                printk(KERN_ERR "NFS: callback service start failed\n");
-               goto err_socks;
+               goto err;
        }
        return 0;
 
-err_socks:
-       svc_rpcb_cleanup(serv, net);
-err_bind:
+err:
        nn->cb_users[minorversion]--;
        dprintk("NFS: Couldn't create callback socket: err = %d; "
                        "net = %x\n", ret, net->ns.inum);