Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

NFS: Remove rpcbind cleanup for NFSv4.0 callback

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>

+3 -5
+3 -5
fs/nfs/callback.c
··· 153 153 ret = svc_bind(serv, net); 154 154 if (ret < 0) { 155 155 printk(KERN_WARNING "NFS: bind callback service failed\n"); 156 - goto err_bind; 156 + goto err; 157 157 } 158 158 159 159 ret = 0; ··· 166 166 167 167 if (ret < 0) { 168 168 printk(KERN_ERR "NFS: callback service start failed\n"); 169 - goto err_socks; 169 + goto err; 170 170 } 171 171 return 0; 172 172 173 - err_socks: 174 - svc_rpcb_cleanup(serv, net); 175 - err_bind: 173 + err: 176 174 nn->cb_users[minorversion]--; 177 175 dprintk("NFS: Couldn't create callback socket: err = %d; " 178 176 "net = %x\n", ret, net->ns.inum);