smb3 client: fix return code mapping of remap_file_range
authorSteve French <stfrench@microsoft.com>
Sun, 24 Aug 2025 02:15:59 +0000 (21:15 -0500)
committerSteve French <stfrench@microsoft.com>
Mon, 25 Aug 2025 14:40:38 +0000 (09:40 -0500)
commit0e08fa789d39aa01923e3ba144bd808291895c3c
tree6fdccc972d814ff58c026d8c423c6549a05ef840
parent1b237f190eb3d36f52dffe07a40b5eb210280e00
smb3 client: fix return code mapping of remap_file_range

We were returning -EOPNOTSUPP for various remap_file_range cases
but for some of these the copy_file_range_syscall() requires -EINVAL
to be returned (e.g. where source and target file ranges overlap when
source and target are the same file). This fixes xfstest generic/157
which was expecting EINVAL for that (and also e.g. for when the src
offset is beyond end of file).

Cc: stable@vger.kernel.org
Acked-by: Paulo Alcantara (Red Hat) <pc@manguebit.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/cifsfs.c