From: J. Bruce Fields Date: Sat, 15 Jan 2011 01:00:02 +0000 (-0500) Subject: nfsd: don't leak dentry count on mnt_want_write failure X-Git-Tag: upstream/snapshot3+hdmi~11454^2~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=541ce98c10111dae7604543dda6c6f7e7a6015d8;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git 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 --- diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index 641117f..fda3be2 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: