SUNRPC: Fix obvious refcounting bugs in rpc_pipefs.
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Sat, 29 Jul 2006 21:37:40 +0000 (17:37 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Thu, 3 Aug 2006 20:57:26 +0000 (16:57 -0400)
Doh!

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
(cherry picked from 496f408f2f0e7ee5481a7c2222189be6c4f5aa6c commit)

net/sunrpc/rpc_pipe.c

index dc6cb93c88308ef0f966b13bf40d09978db0c7c6..a3bd2db2e024d36112394766e42166b0dbb9b0b2 100644 (file)
@@ -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);