]> git.baikalelectronics.ru Git - kernel.git/commit
CIFS: fiemap: do not return EINVAL if get nothing
authorMurphy Zhou <jencce.kernel@gmail.com>
Sat, 14 Mar 2020 03:38:31 +0000 (11:38 +0800)
committerSteve French <stfrench@microsoft.com>
Tue, 17 Mar 2020 18:27:06 +0000 (13:27 -0500)
commita0c902f92c84e6bb072373b4fe43b25c90012c7f
treed3eaad9aff2622fa1497492197830e1179a30d9f
parent865f25a859e5ac11e516f96a3bb9a96c09cc66b7
CIFS: fiemap: do not return EINVAL if get nothing

If we call fiemap on a truncated file with none blocks allocated,
it makes sense we get nothing from this call. No output means
no blocks have been counted, but the call succeeded. It's a valid
response.

Simple example reproducer:
xfs_io -f 'truncate 2M' -c 'fiemap -v' /cifssch/testfile
xfs_io: ioctl(FS_IOC_FIEMAP) ["/cifssch/testfile"]: Invalid argument

Signed-off-by: Murphy Zhou <jencce.kernel@gmail.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com>
CC: Stable <stable@vger.kernel.org>
fs/cifs/smb2ops.c