nfsd: don't leak dentry count on mnt_want_write failure
Subsystems (2)
PATCH 1/1 nfsd: don't leak dentry count on mnt_want_write failure
Just noticed this--seems to be a preexisting problem.
--b.
commit 66b5bec40bae9648277cc1f708b203181065c007
Author: J. Bruce Fields <[email protected]> Date: Fri Jan 14 20:00:02 2011 -0500
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 <[email protected]>
fs/nfsd/vfs.c +6 -6
@@ -1816,22 +1816,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: