NFSD enforce filehandle check for source file in COPY
If the passed in filehandle for the source file in the COPY operation is not a regular file, the server MUST return NFS4ERR_WRONG_TYPE. Signed-off-by: Olga Kornievskaia <kolga@netapp.com> Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
This commit is contained in:
parent
97f8e62572
commit
754035ff79
|
@ -1768,7 +1768,13 @@ static int nfsd4_do_async_copy(void *data)
|
||||||
filp = nfs42_ssc_open(copy->ss_mnt, ©->c_fh,
|
filp = nfs42_ssc_open(copy->ss_mnt, ©->c_fh,
|
||||||
©->stateid);
|
©->stateid);
|
||||||
if (IS_ERR(filp)) {
|
if (IS_ERR(filp)) {
|
||||||
|
switch (PTR_ERR(filp)) {
|
||||||
|
case -EBADF:
|
||||||
|
nfserr = nfserr_wrong_type;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
nfserr = nfserr_offload_denied;
|
nfserr = nfserr_offload_denied;
|
||||||
|
}
|
||||||
nfsd4_interssc_disconnect(copy->ss_mnt);
|
nfsd4_interssc_disconnect(copy->ss_mnt);
|
||||||
goto do_callback;
|
goto do_callback;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue