Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1448692 > unrolled thread

[PATCH 5/7] nfsd: remove unnecessary positive-dentry check

Started by"J. Bruce Fields" <bfields@redhat.com>
First post2016-07-22 20:00 +0200
Last post2016-07-22 20:00 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 5/7] nfsd: remove unnecessary positive-dentry check "J. Bruce Fields" <bfields@redhat.com> - 2016-07-22 20:00 +0200

#1448692 — [PATCH 5/7] nfsd: remove unnecessary positive-dentry check

From"J. Bruce Fields" <bfields@redhat.com>
Date2016-07-22 20:00 +0200
Subject[PATCH 5/7] nfsd: remove unnecessary positive-dentry check
Message-ID<rXMTT-xT-5@gated-at.bofh.it>
From: "J. Bruce Fields" <bfields@redhat.com>

vfs_{create,mkdir,mknod} each begin with a call to may_create(), which
returns EEXIST if the object already exists.

This check is therefore unnecessary.

(In the NFSv2 case, nfsd_proc_create also has such a check.  Contrary to
RFC 1094, our code seems to believe that a CREATE of an existing file
should succeed.  I'm leaving that behavior alone.)

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
---
 fs/nfsd/vfs.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index 9c7830cdaeda..d45b39b408a1 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -1157,17 +1157,7 @@ nfsd_create_locked(struct svc_rqst *rqstp, struct svc_fh *fhp,
 		err = nfserr_io;
 		goto out;
 	}
-	/*
-	 * Make sure the child dentry is still negative ...
-	 */
-	err = nfserr_exist;
-	if (d_really_is_positive(dchild)) {
-		dprintk("nfsd_create: dentry %pd/%pd not negative!\n",
-			dentry, dchild);
-		goto out; 
-	}
 
-	/* Now let's see if we actually have permissions to create */
 	err = nfsd_permission(rqstp, fhp->fh_export, dentry, NFSD_MAY_CREATE);
 	if (err)
 		goto out;
-- 
2.7.4

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web