nfsd: rpc_peeraddr2str needs rcu lock
authorJ. Bruce Fields <bfields@redhat.com>
Mon, 14 Jun 2021 15:20:49 +0000 (11:20 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Wed, 7 Jul 2021 00:14:42 +0000 (20:14 -0400)
I'm not even sure cl_xprt can change here, but we're getting "suspicious
RCU usage" warnings, and other rpc_peeraddr2str callers are taking the
rcu lock.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfs4callback.c

index 84401ca..0f8b10f 100644 (file)
@@ -939,8 +939,10 @@ static int setup_callback_client(struct nfs4_client *clp, struct nfs4_cb_conn *c
        }
        clp->cl_cb_client = client;
        clp->cl_cb_cred = cred;
+       rcu_read_lock();
        trace_nfsd_cb_setup(clp, rpc_peeraddr2str(client, RPC_DISPLAY_NETID),
                            args.authflavor);
+       rcu_read_unlock();
        return 0;
 }