summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@redhat.com>2011-01-15 02:00:02 +0100
committerJ. Bruce Fields <bfields@redhat.com>2011-02-14 16:31:08 +0100
commit541ce98c10111dae7604543dda6c6f7e7a6015d8 (patch)
tree007ffb90e9992569030905a5f0df82e7a0f839f4 /fs
parentLinux 2.6.38-rc2 (diff)
downloadlinux-541ce98c10111dae7604543dda6c6f7e7a6015d8.tar.xz
linux-541ce98c10111dae7604543dda6c6f7e7a6015d8.zip
nfsd: don't leak dentry count on mnt_want_write failure
The exit cleanup isn't quite right here. Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfsd/vfs.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index 641117f2188d..fda3be237773 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -1812,22 +1812,22 @@ nfsd_unlink(struct svc_rqst *rqstp, struct svc_fh *fhp, int type,
host_err = mnt_want_write(fhp->fh_export->ex_path.mnt);
if (host_err)
- goto out_nfserr;
+ goto out_put;
host_err = nfsd_break_lease(rdentry->d_inode);
if (host_err)
- goto out_put;
+ goto out_drop_write;
if (type != S_IFDIR)
host_err = vfs_unlink(dirp, rdentry);
else
host_err = vfs_rmdir(dirp, rdentry);
-out_put:
- dput(rdentry);
-
if (!host_err)
host_err = commit_metadata(fhp);
-
+out_drop_write:
mnt_drop_write(fhp->fh_export->ex_path.mnt);
+out_put:
+ dput(rdentry);
+
out_nfserr:
err = nfserrno(host_err);
out: