Skip to content

Commit 979a266

Browse files
Murphy Zhousmfrench
authored andcommitted
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 <[email protected]> Signed-off-by: Steve French <[email protected]> Reviewed-by: Pavel Shilovsky <[email protected]> CC: Stable <[email protected]>
1 parent 1be1fa4 commit 979a266

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/cifs/smb2ops.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3419,7 +3419,7 @@ static int smb3_fiemap(struct cifs_tcon *tcon,
34193419
if (rc)
34203420
goto out;
34213421

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)) {
34233423
rc = -EINVAL;
34243424
goto out;
34253425
}

0 commit comments

Comments
 (0)