Skip to content

Commit 933496e

Browse files
J. Bruce FieldsTrond Myklebust
authored andcommitted
SUNRPC: 'Directory with parent 'rpc_clnt' already present!'
Each rpc_client has a cl_clid which is allocated from a global ida, and a debugfs directory which is named after cl_clid. We're releasing the cl_clid before we free the debugfs directory named after it. As soon as the cl_clid is released, that value is available for another newly created client. That leaves a window where another client may attempt to create a new debugfs directory with the same name as the not-yet-deleted debugfs directory from the dying client. Symptoms are log messages like Directory 4 with parent 'rpc_clnt' already present! Fixes: 7c4310f "SUNRPC: defer slow parts of rpc_free_client() to a workqueue." Signed-off-by: J. Bruce Fields <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
1 parent 4fa7ef6 commit 933496e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/sunrpc/clnt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -889,6 +889,7 @@ static void rpc_free_client_work(struct work_struct *work)
889889
* here.
890890
*/
891891
rpc_clnt_debugfs_unregister(clnt);
892+
rpc_free_clid(clnt);
892893
rpc_clnt_remove_pipedir(clnt);
893894
xprt_put(rcu_dereference_raw(clnt->cl_xprt));
894895

@@ -910,7 +911,6 @@ rpc_free_client(struct rpc_clnt *clnt)
910911
clnt->cl_metrics = NULL;
911912
xprt_iter_destroy(&clnt->cl_xpi);
912913
put_cred(clnt->cl_cred);
913-
rpc_free_clid(clnt);
914914

915915
INIT_WORK(&clnt->cl_work, rpc_free_client_work);
916916
schedule_work(&clnt->cl_work);

0 commit comments

Comments
 (0)