summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2006-07-29 23:37:40 +0200
committerTrond Myklebust <Trond.Myklebust@netapp.com>2006-08-03 22:57:26 +0200
commit5c3e985a2c1908aa97221d3806f85ce7e2fbfa88 (patch)
tree5ffae9134b9ce0ee1c92324d3483963a5b3e075d /net
parentRPC: Ensure that we disconnect TCP socket when client requests error out (diff)
downloadlinux-5c3e985a2c1908aa97221d3806f85ce7e2fbfa88.tar.xz
linux-5c3e985a2c1908aa97221d3806f85ce7e2fbfa88.zip
SUNRPC: Fix obvious refcounting bugs in rpc_pipefs.
Doh! Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> (cherry picked from 496f408f2f0e7ee5481a7c2222189be6c4f5aa6c commit)
Diffstat (limited to 'net')
-rw-r--r--net/sunrpc/rpc_pipe.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
index dc6cb93c8830..a3bd2db2e024 100644
--- a/net/sunrpc/rpc_pipe.c
+++ b/net/sunrpc/rpc_pipe.c
@@ -667,10 +667,11 @@ rpc_mkdir(char *path, struct rpc_clnt *rpc_client)
RPCAUTH_info, RPCAUTH_EOF);
if (error)
goto err_depopulate;
+ dget(dentry);
out:
mutex_unlock(&dir->i_mutex);
rpc_release_path(&nd);
- return dget(dentry);
+ return dentry;
err_depopulate:
rpc_depopulate(dentry);
__rpc_rmdir(dir, dentry);
@@ -731,10 +732,11 @@ rpc_mkpipe(char *path, void *private, struct rpc_pipe_ops *ops, int flags)
rpci->flags = flags;
rpci->ops = ops;
inode_dir_notify(dir, DN_CREATE);
+ dget(dentry);
out:
mutex_unlock(&dir->i_mutex);
rpc_release_path(&nd);
- return dget(dentry);
+ return dentry;
err_dput:
dput(dentry);
dentry = ERR_PTR(-ENOMEM);