Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Murphy Zhou and committed by
Steve French
979a2665 1be1fa42

+1 -1
+1 -1
fs/cifs/smb2ops.c
··· 3419 3419 if (rc) 3420 3420 goto out; 3421 3421 3422 - if (out_data_len < sizeof(struct file_allocated_range_buffer)) { 3422 + if (out_data_len && out_data_len < sizeof(struct file_allocated_range_buffer)) { 3423 3423 rc = -EINVAL; 3424 3424 goto out; 3425 3425 }