Merge tag 'v7.1-rc6-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6

Pull smb client fixes from Steve French:

 - fix uninitialized variable in smb2_writev_callback()

 - detect short folioq copy in cifs_copy_folioq_to_iter()

* tag 'v7.1-rc6-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6:
  smb: client: fix uninitialized variable in smb2_writev_callback
  smb: client: detect short folioq copy in cifs_copy_folioq_to_iter()
This commit is contained in:
Linus Torvalds
2026-05-30 17:05:58 -07:00
2 changed files with 16 additions and 4 deletions
+15 -3
View File
@@ -4706,9 +4706,15 @@ cifs_copy_folioq_to_iter(struct folio_queue *folioq, size_t data_size,
{
for (; folioq; folioq = folioq->next) {
for (int s = 0; s < folioq_count(folioq); s++) {
struct folio *folio = folioq_folio(folioq, s);
size_t fsize = folio_size(folio);
size_t n, len = umin(fsize - skip, data_size);
struct folio *folio;
size_t fsize, n, len;
if (data_size == 0)
return 0;
folio = folioq_folio(folioq, s);
fsize = folio_size(folio);
len = umin(fsize - skip, data_size);
n = copy_folio_to_iter(folio, skip, len, iter);
if (n != len) {
@@ -4721,6 +4727,12 @@ cifs_copy_folioq_to_iter(struct folio_queue *folioq, size_t data_size,
}
}
if (data_size != 0) {
cifs_dbg(VFS, "%s: short copy, %zu bytes missing\n",
__func__, data_size);
return smb_EIO2(smb_eio_trace_rx_copy_to_iter, 0, data_size);
}
return 0;
}
+1 -1
View File
@@ -4955,7 +4955,7 @@ smb2_writev_callback(struct TCP_Server_Info *server, struct mid_q_entry *mid)
unsigned int rreq_debug_id = wdata->rreq->debug_id;
unsigned int subreq_debug_index = wdata->subreq.debug_index;
ssize_t result = 0;
size_t written;
size_t written = 0;
WARN_ONCE(wdata->server != server,
"wdata server %p != mid server %p",