summaryrefslogtreecommitdiffstats
path: root/fs/nfsd/vfs.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2018-05-25 08:02:43 +0200
committerIngo Molnar <mingo@kernel.org>2018-05-25 08:02:43 +0200
commitbd9c67ad9693bacef086d65c1c6744645d4777e7 (patch)
tree1dcbac332819a79dbaa1a1a836a8485f866568ad /fs/nfsd/vfs.c
parent861410270ab5b13f72fc9afc74fa60f3eb7c2b7e (diff)
parentb50694381cfc22dce3a60a291cdae294a5e5777c (diff)
downloadlinux-bd9c67ad9693bacef086d65c1c6744645d4777e7.tar.gz
linux-bd9c67ad9693bacef086d65c1c6744645d4777e7.tar.bz2
linux-bd9c67ad9693bacef086d65c1c6744645d4777e7.zip
Merge branch 'linus' into perf/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'fs/nfsd/vfs.c')
-rw-r--r--fs/nfsd/vfs.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index 2410b093a2e6..b0555d7d8200 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -1201,6 +1201,28 @@ nfsd_create_locked(struct svc_rqst *rqstp, struct svc_fh *fhp,
break;
case S_IFDIR:
host_err = vfs_mkdir(dirp, dchild, iap->ia_mode);
+ if (!host_err && unlikely(d_unhashed(dchild))) {
+ struct dentry *d;
+ d = lookup_one_len(dchild->d_name.name,
+ dchild->d_parent,
+ dchild->d_name.len);
+ if (IS_ERR(d)) {
+ host_err = PTR_ERR(d);
+ break;
+ }
+ if (unlikely(d_is_negative(d))) {
+ dput(d);
+ err = nfserr_serverfault;
+ goto out;
+ }
+ dput(resfhp->fh_dentry);
+ resfhp->fh_dentry = dget(d);
+ err = fh_update(resfhp);
+ dput(dchild);
+ dchild = d;
+ if (err)
+ goto out;
+ }
break;
case S_IFCHR:
case S_IFBLK: