summaryrefslogtreecommitdiffstats
path: root/fs/nfsd/vfs.c
diff options
context:
space:
mode:
authorLinus Torvalds2016-08-13 01:28:41 +0200
committerLinus Torvalds2016-08-13 01:28:41 +0200
commitb112324c2b11e74ea6ed856d7db5cba5125acce3 (patch)
tree700e34e0cc0d43e3c2e6788326d4ad6972fd9cb2 /fs/nfsd/vfs.c
parentMerge tag 'pm-4.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafae... (diff)
parentnfsd: don't return an unhashed lock stateid after taking mutex (diff)
downloadkernel-qcow2-linux-b112324c2b11e74ea6ed856d7db5cba5125acce3.tar.gz
kernel-qcow2-linux-b112324c2b11e74ea6ed856d7db5cba5125acce3.tar.xz
kernel-qcow2-linux-b112324c2b11e74ea6ed856d7db5cba5125acce3.zip
Merge tag 'nfsd-4.8-1' of git://linux-nfs.org/~bfields/linux
Pull nfsd fixes from Bruce Fields: "Fixes for the dentry refcounting leak I introduced in 4.8-rc1, and for races in the LOCK code which appear to go back to the big nfsd state lock removal from 3.17" * tag 'nfsd-4.8-1' of git://linux-nfs.org/~bfields/linux: nfsd: don't return an unhashed lock stateid after taking mutex nfsd: Fix race between FREE_STATEID and LOCK nfsd: fix dentry refcounting on create
Diffstat (limited to 'fs/nfsd/vfs.c')
-rw-r--r--fs/nfsd/vfs.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index ba944123167b..ff476e654b8f 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -1252,10 +1252,13 @@ nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp,
if (IS_ERR(dchild))
return nfserrno(host_err);
err = fh_compose(resfhp, fhp->fh_export, dchild, fhp);
- if (err) {
- dput(dchild);
+ /*
+ * We unconditionally drop our ref to dchild as fh_compose will have
+ * already grabbed its own ref for it.
+ */
+ dput(dchild);
+ if (err)
return err;
- }
return nfsd_create_locked(rqstp, fhp, fname, flen, iap, type,
rdev, resfhp);
}