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.

Merge tag '6.10-rc4-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6

Pull smb client fixes from Steve French:
"Five smb3 client fixes

- three nets/fiolios cifs fixes

- fix typo in module parameters description

- fix incorrect swap warning"

* tag '6.10-rc4-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6:
cifs: Move the 'pid' from the subreq to the req
cifs: Only pick a channel once per read request
cifs: Defer read completion
cifs: fix typo in module parameter enable_gcm_256
cifs: drop the incorrect assertion in cifs_swap_rw()

+27 -32
+1 -1
fs/smb/client/cifsfs.c
··· 134 134 MODULE_PARM_DESC(enable_oplocks, "Enable or disable oplocks. Default: y/Y/1"); 135 135 136 136 module_param(enable_gcm_256, bool, 0644); 137 - MODULE_PARM_DESC(enable_gcm_256, "Enable requesting strongest (256 bit) GCM encryption. Default: n/N/0"); 137 + MODULE_PARM_DESC(enable_gcm_256, "Enable requesting strongest (256 bit) GCM encryption. Default: y/Y/0"); 138 138 139 139 module_param(require_gcm_256, bool, 0644); 140 140 MODULE_PARM_DESC(require_gcm_256, "Require strongest (256 bit) GCM encryption. Default: n/N/0");
+2 -1
fs/smb/client/cifsglob.h
··· 1494 1494 struct cifs_io_request { 1495 1495 struct netfs_io_request rreq; 1496 1496 struct cifsFileInfo *cfile; 1497 + struct TCP_Server_Info *server; 1498 + pid_t pid; 1497 1499 }; 1498 1500 1499 1501 /* asynchronous read support */ ··· 1506 1504 struct cifs_io_request *req; 1507 1505 }; 1508 1506 ssize_t got_bytes; 1509 - pid_t pid; 1510 1507 unsigned int xid; 1511 1508 int result; 1512 1509 bool have_xid;
+4 -4
fs/smb/client/cifssmb.c
··· 1345 1345 if (rc) 1346 1346 return rc; 1347 1347 1348 - smb->hdr.Pid = cpu_to_le16((__u16)rdata->pid); 1349 - smb->hdr.PidHigh = cpu_to_le16((__u16)(rdata->pid >> 16)); 1348 + smb->hdr.Pid = cpu_to_le16((__u16)rdata->req->pid); 1349 + smb->hdr.PidHigh = cpu_to_le16((__u16)(rdata->req->pid >> 16)); 1350 1350 1351 1351 smb->AndXCommand = 0xFF; /* none */ 1352 1352 smb->Fid = rdata->req->cfile->fid.netfid; ··· 1689 1689 if (rc) 1690 1690 goto async_writev_out; 1691 1691 1692 - smb->hdr.Pid = cpu_to_le16((__u16)wdata->pid); 1693 - smb->hdr.PidHigh = cpu_to_le16((__u16)(wdata->pid >> 16)); 1692 + smb->hdr.Pid = cpu_to_le16((__u16)wdata->req->pid); 1693 + smb->hdr.PidHigh = cpu_to_le16((__u16)(wdata->req->pid >> 16)); 1694 1694 1695 1695 smb->AndXCommand = 0xFF; /* none */ 1696 1696 smb->Fid = wdata->req->cfile->fid.netfid;
+6 -21
fs/smb/client/file.c
··· 134 134 static bool cifs_clamp_length(struct netfs_io_subrequest *subreq) 135 135 { 136 136 struct netfs_io_request *rreq = subreq->rreq; 137 - struct TCP_Server_Info *server; 138 137 struct cifs_io_subrequest *rdata = container_of(subreq, struct cifs_io_subrequest, subreq); 139 138 struct cifs_io_request *req = container_of(subreq->rreq, struct cifs_io_request, rreq); 139 + struct TCP_Server_Info *server = req->server; 140 140 struct cifs_sb_info *cifs_sb = CIFS_SB(rreq->inode->i_sb); 141 141 size_t rsize = 0; 142 142 int rc; 143 143 144 144 rdata->xid = get_xid(); 145 145 rdata->have_xid = true; 146 - 147 - server = cifs_pick_channel(tlink_tcon(req->cfile->tlink)->ses); 148 146 rdata->server = server; 149 147 150 148 if (cifs_sb->ctx->rsize == 0) ··· 177 179 struct netfs_io_request *rreq = subreq->rreq; 178 180 struct cifs_io_subrequest *rdata = container_of(subreq, struct cifs_io_subrequest, subreq); 179 181 struct cifs_io_request *req = container_of(subreq->rreq, struct cifs_io_request, rreq); 180 - struct cifs_sb_info *cifs_sb = CIFS_SB(rreq->inode->i_sb); 181 - pid_t pid; 182 182 int rc = 0; 183 - 184 - if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_RWPIDFORWARD) 185 - pid = req->cfile->pid; 186 - else 187 - pid = current->tgid; // Ummm... This may be a workqueue 188 183 189 184 cifs_dbg(FYI, "%s: op=%08x[%x] mapping=%p len=%zu/%zu\n", 190 185 __func__, rreq->debug_id, subreq->debug_index, rreq->mapping, ··· 192 201 } 193 202 194 203 __set_bit(NETFS_SREQ_CLEAR_TAIL, &subreq->flags); 195 - rdata->pid = pid; 196 204 197 - rc = adjust_credits(rdata->server, &rdata->credits, rdata->subreq.len); 198 - if (!rc) { 199 - if (rdata->req->cfile->invalidHandle) 200 - rc = -EAGAIN; 201 - else 202 - rc = rdata->server->ops->async_readv(rdata); 203 - } 204 - 205 + rc = rdata->server->ops->async_readv(rdata); 205 206 out: 206 207 if (rc) 207 208 netfs_subreq_terminated(subreq, rc, false); ··· 228 245 229 246 rreq->rsize = cifs_sb->ctx->rsize; 230 247 rreq->wsize = cifs_sb->ctx->wsize; 248 + req->pid = current->tgid; // Ummm... This may be a workqueue 231 249 232 250 if (file) { 233 251 open_file = file->private_data; 234 252 rreq->netfs_priv = file->private_data; 235 253 req->cfile = cifsFileInfo_get(open_file); 254 + req->server = cifs_pick_channel(tlink_tcon(req->cfile->tlink)->ses); 255 + if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_RWPIDFORWARD) 256 + req->pid = req->cfile->pid; 236 257 } else if (rreq->origin != NETFS_WRITEBACK) { 237 258 WARN_ON_ONCE(1); 238 259 return -EIO; ··· 3186 3199 static int cifs_swap_rw(struct kiocb *iocb, struct iov_iter *iter) 3187 3200 { 3188 3201 ssize_t ret; 3189 - 3190 - WARN_ON_ONCE(iov_iter_count(iter) != PAGE_SIZE); 3191 3202 3192 3203 if (iov_iter_rw(iter) == READ) 3193 3204 ret = netfs_unbuffered_read_iter_locked(iocb, iter);
+14 -5
fs/smb/client/smb2pdu.c
··· 4484 4484 return rc; 4485 4485 } 4486 4486 4487 + static void smb2_readv_worker(struct work_struct *work) 4488 + { 4489 + struct cifs_io_subrequest *rdata = 4490 + container_of(work, struct cifs_io_subrequest, subreq.work); 4491 + 4492 + netfs_subreq_terminated(&rdata->subreq, 4493 + (rdata->result == 0 || rdata->result == -EAGAIN) ? 4494 + rdata->got_bytes : rdata->result, true); 4495 + } 4496 + 4487 4497 static void 4488 4498 smb2_readv_callback(struct mid_q_entry *mid) 4489 4499 { ··· 4588 4578 rdata->result = 0; 4589 4579 } 4590 4580 rdata->credits.value = 0; 4591 - netfs_subreq_terminated(&rdata->subreq, 4592 - (rdata->result == 0 || rdata->result == -EAGAIN) ? 4593 - rdata->got_bytes : rdata->result, true); 4581 + INIT_WORK(&rdata->subreq.work, smb2_readv_worker); 4582 + queue_work(cifsiod_wq, &rdata->subreq.work); 4594 4583 release_mid(mid); 4595 4584 add_credits(server, &credits, 0); 4596 4585 } ··· 4621 4612 io_parms.length = rdata->subreq.len; 4622 4613 io_parms.persistent_fid = rdata->req->cfile->fid.persistent_fid; 4623 4614 io_parms.volatile_fid = rdata->req->cfile->fid.volatile_fid; 4624 - io_parms.pid = rdata->pid; 4615 + io_parms.pid = rdata->req->pid; 4625 4616 4626 4617 rc = smb2_new_read_req( 4627 4618 (void **) &buf, &total_len, &io_parms, rdata, 0, 0); ··· 4873 4864 .length = wdata->subreq.len, 4874 4865 .persistent_fid = wdata->req->cfile->fid.persistent_fid, 4875 4866 .volatile_fid = wdata->req->cfile->fid.volatile_fid, 4876 - .pid = wdata->pid, 4867 + .pid = wdata->req->pid, 4877 4868 }; 4878 4869 io_parms = &_io_parms; 4879 4870