]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
nfsd: document callback_wq serialization of callback code
authorJ. Bruce Fields <bfields@redhat.com>
Tue, 29 Oct 2019 20:02:18 +0000 (16:02 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Fri, 8 Nov 2019 17:32:59 +0000 (12:32 -0500)
The callback code relies on the fact that much of it is only ever called
from the ordered workqueue callback_wq, and this is worth documenting.

Reported-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfs4callback.c

index c94768b096a3d7f4ec5b76de376db91157e6e8db..24534db87e8606ee9bb72520f4590d0bf462970d 100644 (file)
@@ -1243,6 +1243,12 @@ static struct nfsd4_conn * __nfsd4_find_backchannel(struct nfs4_client *clp)
        return NULL;
 }
 
+/*
+ * Note there isn't a lot of locking in this code; instead we depend on
+ * the fact that it is run from the callback_wq, which won't run two
+ * work items at once.  So, for example, callback_wq handles all access
+ * of cl_cb_client and all calls to rpc_create or rpc_shutdown_client.
+ */
 static void nfsd4_process_cb_update(struct nfsd4_callback *cb)
 {
        struct nfs4_cb_conn conn;