Commit d03d9fe4 authored by J. Bruce Fields's avatar J. Bruce Fields

nfsd: remove unnecessary positive-dentry check

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: default avatarJ. Bruce Fields <bfields@redhat.com>
parent b44061d0
...@@ -1157,17 +1157,7 @@ nfsd_create_locked(struct svc_rqst *rqstp, struct svc_fh *fhp, ...@@ -1157,17 +1157,7 @@ nfsd_create_locked(struct svc_rqst *rqstp, struct svc_fh *fhp,
err = nfserr_io; err = nfserr_io;
goto out; 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); err = nfsd_permission(rqstp, fhp->fh_export, dentry, NFSD_MAY_CREATE);
if (err) if (err)
goto out; goto out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment