aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/vfs.c
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@redhat.com>2011-01-14 20:00:02 -0500
committerJ. Bruce Fields <bfields@redhat.com>2011-02-14 10:31:08 -0500
commit541ce98c10111dae7604543dda6c6f7e7a6015d8 (patch)
tree007ffb90e9992569030905a5f0df82e7a0f839f4 /fs/nfsd/vfs.c
parent1bae4ce27c9c90344f23c65ea6966c50ffeae2f5 (diff)
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/nfsd/vfs.c')
-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,
1812 1812
1813 host_err = mnt_want_write(fhp->fh_export->ex_path.mnt); 1813 host_err = mnt_want_write(fhp->fh_export->ex_path.mnt);
1814 if (host_err) 1814 if (host_err)
1815 goto out_nfserr; 1815 goto out_put;
1816 1816
1817 host_err = nfsd_break_lease(rdentry->d_inode); 1817 host_err = nfsd_break_lease(rdentry->d_inode);
1818 if (host_err) 1818 if (host_err)
1819 goto out_put; 1819 goto out_drop_write;
1820 if (type != S_IFDIR) 1820 if (type != S_IFDIR)
1821 host_err = vfs_unlink(dirp, rdentry); 1821 host_err = vfs_unlink(dirp, rdentry);
1822 else 1822 else
1823 host_err = vfs_rmdir(dirp, rdentry); 1823 host_err = vfs_rmdir(dirp, rdentry);
1824out_put:
1825 dput(rdentry);
1826
1827 if (!host_err) 1824 if (!host_err)
1828 host_err = commit_metadata(fhp); 1825 host_err = commit_metadata(fhp);
1829 1826out_drop_write:
1830 mnt_drop_write(fhp->fh_export->ex_path.mnt); 1827 mnt_drop_write(fhp->fh_export->ex_path.mnt);
1828out_put:
1829 dput(rdentry);
1830
1831out_nfserr: 1831out_nfserr:
1832 err = nfserrno(host_err); 1832 err = nfserrno(host_err);
1833out: 1833out: