linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] nfsd: don't leak dentry count on mnt_want_write failure
@ 2011-01-15  1:04 J. Bruce Fields
  0 siblings, 0 replies; only message in thread
From: J. Bruce Fields @ 2011-01-15  1:04 UTC (permalink / raw)
  To: linux-nfs

Just noticed this--seems to be a preexisting problem.

--b.

commit 66b5bec40bae9648277cc1f708b203181065c007
Author: J. Bruce Fields <bfields@redhat.com>
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 <bfields@redhat.com>

diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index a110adb..56a2b68 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -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:

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2011-01-15  1:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-15  1:04 [PATCH] nfsd: don't leak dentry count on mnt_want_write failure J. Bruce Fields

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).