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

nfsd: clean up bad-type check in nfsd_create_locked

Minor cleanup, no change in behavior.
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent d03d9fe4
...@@ -1166,13 +1166,6 @@ nfsd_create_locked(struct svc_rqst *rqstp, struct svc_fh *fhp, ...@@ -1166,13 +1166,6 @@ nfsd_create_locked(struct svc_rqst *rqstp, struct svc_fh *fhp,
iap->ia_mode = 0; iap->ia_mode = 0;
iap->ia_mode = (iap->ia_mode & S_IALLUGO) | type; iap->ia_mode = (iap->ia_mode & S_IALLUGO) | type;
err = nfserr_inval;
if (!S_ISREG(type) && !S_ISDIR(type) && !special_file(type)) {
printk(KERN_WARNING "nfsd: bad file type %o in nfsd_create\n",
type);
goto out;
}
err = 0; err = 0;
host_err = 0; host_err = 0;
switch (type) { switch (type) {
...@@ -1190,6 +1183,10 @@ nfsd_create_locked(struct svc_rqst *rqstp, struct svc_fh *fhp, ...@@ -1190,6 +1183,10 @@ nfsd_create_locked(struct svc_rqst *rqstp, struct svc_fh *fhp,
case S_IFSOCK: case S_IFSOCK:
host_err = vfs_mknod(dirp, dchild, iap->ia_mode, rdev); host_err = vfs_mknod(dirp, dchild, iap->ia_mode, rdev);
break; break;
default:
printk(KERN_WARNING "nfsd: bad file type %o in nfsd_create\n",
type);
host_err = -EINVAL;
} }
if (host_err < 0) if (host_err < 0)
goto out_nfserr; goto out_nfserr;
......
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