mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 05:00:55 +07:00
NFSD: MKNOD should return NFSERR_BADTYPE instead of NFSERR_INVAL
A late paragraph of RFC 1813 Section 3.3.11 states: | ... if the server does not support the target type or the | target type is illegal, the error, NFS3ERR_BADTYPE, should | be returned. Note that NF3REG, NF3DIR, and NF3LNK are | illegal types for MKNOD. The Linux NFS server incorrectly returns NFSERR_INVAL in these cases. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
This commit is contained in:
parent
d321ff589c
commit
66d60e3ad1
@ -316,10 +316,6 @@ nfsd3_proc_mknod(struct svc_rqst *rqstp)
|
|||||||
fh_copy(&resp->dirfh, &argp->fh);
|
fh_copy(&resp->dirfh, &argp->fh);
|
||||||
fh_init(&resp->fh, NFS3_FHSIZE);
|
fh_init(&resp->fh, NFS3_FHSIZE);
|
||||||
|
|
||||||
if (argp->ftype == 0 || argp->ftype >= NF3BAD) {
|
|
||||||
resp->status = nfserr_inval;
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
if (argp->ftype == NF3CHR || argp->ftype == NF3BLK) {
|
if (argp->ftype == NF3CHR || argp->ftype == NF3BLK) {
|
||||||
rdev = MKDEV(argp->major, argp->minor);
|
rdev = MKDEV(argp->major, argp->minor);
|
||||||
if (MAJOR(rdev) != argp->major ||
|
if (MAJOR(rdev) != argp->major ||
|
||||||
@ -328,7 +324,7 @@ nfsd3_proc_mknod(struct svc_rqst *rqstp)
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
} else if (argp->ftype != NF3SOCK && argp->ftype != NF3FIFO) {
|
} else if (argp->ftype != NF3SOCK && argp->ftype != NF3FIFO) {
|
||||||
resp->status = nfserr_inval;
|
resp->status = nfserr_badtype;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user