All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cifs: fix pcchunk length type in smb2_copychunk_range
@ 2023-05-05 15:14 Pawel Witek
       [not found] ` <CAH2r5mszw6sayQfJqiYwTjPCqKDB7Dk-Hmtr0-Z3fXf=e3t0aQ@mail.gmail.com>
  0 siblings, 1 reply; 6+ messages in thread
From: Pawel Witek @ 2023-05-05 15:14 UTC (permalink / raw)
  To: linux-cifs

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.

Signed-off-by: Pawel Witek <pawel.ireneusz.witek@gmail.com>
---
 fs/cifs/smb2ops.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c
index a81758225fcd..35c7c35882c9 100644
--- a/fs/cifs/smb2ops.c
+++ b/fs/cifs/smb2ops.c
@@ -1682,7 +1682,7 @@ smb2_copychunk_range(const unsigned int xid,
 		pcchunk->SourceOffset = cpu_to_le64(src_off);
 		pcchunk->TargetOffset = cpu_to_le64(dest_off);
 		pcchunk->Length =
-			cpu_to_le32(min_t(u32, len, tcon->max_bytes_chunk));
+			cpu_to_le64(min_t(u64, len, tcon->max_bytes_chunk));
 
 		/* Request server copy to target from src identified by key */
 		kfree(retbuf);
-- 
2.40.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-05-06  8:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-05 15:14 [PATCH] cifs: fix pcchunk length type in smb2_copychunk_range Pawel Witek
     [not found] ` <CAH2r5mszw6sayQfJqiYwTjPCqKDB7Dk-Hmtr0-Z3fXf=e3t0aQ@mail.gmail.com>
2023-05-05 16:47   ` Fwd: " Steve French
2023-05-05 19:31   ` Pawel Witek
     [not found]     ` <CAH2r5mvCCY=VT9ZUkjz4c+QGZ0MjR4ggdG56QUa-apZ7eoeo0A@mail.gmail.com>
2023-05-06  4:49       ` Steve French
2023-05-06  4:51         ` Steve French
2023-05-06  8:06           ` Pawel Witek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.