Skip to content

Commit d66cde5

Browse files
Pawel Witeksmfrench
authored andcommitted
cifs: fix pcchunk length type in smb2_copychunk_range
Change type of pcchunk->Length from u32 to u64 to match smb2_copychunk_range arguments type. Fixes the problem where performing server-side copy with CIFS_IOC_COPYCHUNK_FILE ioctl resulted in incomplete copy of large files while returning -EINVAL. Fixes: 9bf0c9c ("CIFS: Fix SMB2/SMB3 Copy offload support (refcopy) for large files") Cc: <[email protected]> Signed-off-by: Pawel Witek <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent ac9a786 commit d66cde5

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
@@ -1682,7 +1682,7 @@ smb2_copychunk_range(const unsigned int xid,
16821682
pcchunk->SourceOffset = cpu_to_le64(src_off);
16831683
pcchunk->TargetOffset = cpu_to_le64(dest_off);
16841684
pcchunk->Length =
1685-
cpu_to_le32(min_t(u32, len, tcon->max_bytes_chunk));
1685+
cpu_to_le32(min_t(u64, len, tcon->max_bytes_chunk));
16861686

16871687
/* Request server copy to target from src identified by key */
16881688
kfree(retbuf);

0 commit comments

Comments
 (0)