Skip to content

Commit e615685

Browse files
committed
NFSD: Clean up nfsd3_proc_create()
As near as I can tell, mode bit masking and setting S_IFREG is already done by do_nfsd_create() and vfs_create(). The NFSv4 path (do_open_lookup), for example, does not bother with this special processing. Signed-off-by: Chuck Lever <[email protected]>
1 parent 2059b69 commit e615685

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

fs/nfsd/nfs3proc.c

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,7 @@ nfsd3_proc_create(struct svc_rqst *rqstp)
229229
{
230230
struct nfsd3_createargs *argp = rqstp->rq_argp;
231231
struct nfsd3_diropres *resp = rqstp->rq_resp;
232-
svc_fh *dirfhp, *newfhp = NULL;
233-
struct iattr *attr;
232+
svc_fh *dirfhp, *newfhp;
234233

235234
dprintk("nfsd: CREATE(3) %s %.*s\n",
236235
SVCFH_fmt(&argp->fh),
@@ -239,20 +238,9 @@ nfsd3_proc_create(struct svc_rqst *rqstp)
239238

240239
dirfhp = fh_copy(&resp->dirfh, &argp->fh);
241240
newfhp = fh_init(&resp->fh, NFS3_FHSIZE);
242-
attr = &argp->attrs;
243-
244-
/* Unfudge the mode bits */
245-
attr->ia_mode &= ~S_IFMT;
246-
if (!(attr->ia_valid & ATTR_MODE)) {
247-
attr->ia_valid |= ATTR_MODE;
248-
attr->ia_mode = S_IFREG;
249-
} else {
250-
attr->ia_mode = (attr->ia_mode & ~S_IFMT) | S_IFREG;
251-
}
252241

253-
/* Now create the file and set attributes */
254242
resp->status = do_nfsd_create(rqstp, dirfhp, argp->name, argp->len,
255-
attr, newfhp, argp->createmode,
243+
&argp->attrs, newfhp, argp->createmode,
256244
(u32 *)argp->verf, NULL, NULL);
257245
return rpc_success;
258246
}

0 commit comments

Comments
 (0)