Commit 754035ff authored by Olga Kornievskaia's avatar Olga Kornievskaia Committed by Chuck Lever

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: default avatarOlga Kornievskaia <kolga@netapp.com>
Reviewed-by: default avatarJeff Layton <jlayton@kernel.org>
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
parent 97f8e625
......@@ -1768,7 +1768,13 @@ static int nfsd4_do_async_copy(void *data)
filp = nfs42_ssc_open(copy->ss_mnt, &copy->c_fh,
&copy->stateid);
if (IS_ERR(filp)) {
nfserr = nfserr_offload_denied;
switch (PTR_ERR(filp)) {
case -EBADF:
nfserr = nfserr_wrong_type;
break;
default:
nfserr = nfserr_offload_denied;
}
nfsd4_interssc_disconnect(copy->ss_mnt);
goto do_callback;
}
......
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