Skip to contentSkip to conversation

rpc_pipe: remove the clntXX dir if creating the pipe fails

PATCH New Jeff Layton 1 participant 1 message Dec 5, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rpc_pipe: remove the clntXX dir if creating the pipe fails

In the event that we create the gssd/clntXX dir, but the pipe creation subsequently fails, then we should remove the clntXX dir before returning.

---
 net/sunrpc/rpc_pipe.c | 2 ++
 1 file changed, 2 insertions(+)
net/sunrpc/rpc_pipe.c +2 -0
index 5cd7ad1..0b74c61 100644
@@ -1313,6 +1313,8 @@ rpc_gssd_dummy_populate(struct dentry *root, struct rpc_pipe *pipe_data)
 	}
 
 	pipe_dentry = rpc_mkpipe_dentry(clnt_dentry, "gssd", NULL, pipe_data);
+	if (IS_ERR(pipe_dentry))
+		__rpc_depopulate(gssd_dentry, gssd_dummy_clnt_dir, 0, 1);
 out:
 	dput(clnt_dentry);
 	dput(gssd_dentry);
Signature · 1 line
1.8.4.2