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.18-rc2-smb-client-fixes' of git://git.samba.org/sfrench/cifs-2.6

Pull smb client fixes from Steve French:

- add missing tracepoints

- smbdirect (RDMA) fix

- fix potential issue with credits underflow

- rename fix

- improvement to calc_signature and additional cleanup patch

* tag '6.18-rc2-smb-client-fixes' of git://git.samba.org/sfrench/cifs-2.6:
cifs: #include cifsglob.h before trace.h to allow structs in tracepoints
cifs: Call the calc_signature functions directly
smb: client: get rid of d_drop() in cifs_do_rename()
cifs: Fix TCP_Server_Info::credits to be signed
cifs: Add a couple of missing smb3_rw_credits tracepoints
smb: client: allocate enough space for MR WRs and ib_drain_qp()

+44 -39
+1 -3
fs/smb/client/cifsglob.h
··· 534 534 void (*new_lease_key)(struct cifs_fid *); 535 535 int (*generate_signingkey)(struct cifs_ses *ses, 536 536 struct TCP_Server_Info *server); 537 - int (*calc_signature)(struct smb_rqst *, struct TCP_Server_Info *, 538 - bool allocate_crypto); 539 537 int (*set_integrity)(const unsigned int, struct cifs_tcon *tcon, 540 538 struct cifsFileInfo *src_file); 541 539 int (*enum_snapshots)(const unsigned int xid, struct cifs_tcon *tcon, ··· 730 732 bool nosharesock; 731 733 bool tcp_nodelay; 732 734 bool terminate; 733 - unsigned int credits; /* send no more requests at once */ 735 + int credits; /* send no more requests at once */ 734 736 unsigned int max_credits; /* can override large 32000 default at mnt */ 735 737 unsigned int in_flight; /* number of requests on the wire to server */ 736 738 unsigned int max_in_flight; /* max number of requests that were on wire */
+1
fs/smb/client/cifsproto.h
··· 9 9 #define _CIFSPROTO_H 10 10 #include <linux/nls.h> 11 11 #include <linux/ctype.h> 12 + #include "cifsglob.h" 12 13 #include "trace.h" 13 14 #ifdef CONFIG_CIFS_DFS_UPCALL 14 15 #include "dfs_cache.h"
+8
fs/smb/client/cifssmb.c
··· 1311 1311 .rreq_debug_id = rdata->rreq->debug_id, 1312 1312 .rreq_debug_index = rdata->subreq.debug_index, 1313 1313 }; 1314 + unsigned int rreq_debug_id = rdata->rreq->debug_id; 1315 + unsigned int subreq_debug_index = rdata->subreq.debug_index; 1314 1316 1315 1317 cifs_dbg(FYI, "%s: mid=%llu state=%d result=%d bytes=%zu\n", 1316 1318 __func__, mid->mid, mid->mid_state, rdata->result, ··· 1376 1374 __set_bit(NETFS_SREQ_MADE_PROGRESS, &rdata->subreq.flags); 1377 1375 } 1378 1376 1377 + trace_smb3_rw_credits(rreq_debug_id, subreq_debug_index, rdata->credits.value, 1378 + server->credits, server->in_flight, 1379 + 0, cifs_trace_rw_credits_read_response_clear); 1379 1380 rdata->credits.value = 0; 1380 1381 rdata->subreq.error = rdata->result; 1381 1382 rdata->subreq.transferred += rdata->got_bytes; ··· 1386 1381 netfs_read_subreq_terminated(&rdata->subreq); 1387 1382 release_mid(mid); 1388 1383 add_credits(server, &credits, 0); 1384 + trace_smb3_rw_credits(rreq_debug_id, subreq_debug_index, 0, 1385 + server->credits, server->in_flight, 1386 + credits.value, cifs_trace_rw_credits_read_response_add); 1389 1387 } 1390 1388 1391 1389 /* cifs_async_readv - send an async write, and set up mid to handle result */
+1 -4
fs/smb/client/inode.c
··· 2484 2484 } 2485 2485 #endif /* CONFIG_CIFS_ALLOW_INSECURE_LEGACY */ 2486 2486 do_rename_exit: 2487 - if (rc == 0) { 2487 + if (rc == 0) 2488 2488 d_move(from_dentry, to_dentry); 2489 - /* Force a new lookup */ 2490 - d_drop(from_dentry); 2491 - } 2492 2489 cifs_put_tlink(tlink); 2493 2490 return rc; 2494 2491 }
-4
fs/smb/client/smb2ops.c
··· 5446 5446 .get_lease_key = smb2_get_lease_key, 5447 5447 .set_lease_key = smb2_set_lease_key, 5448 5448 .new_lease_key = smb2_new_lease_key, 5449 - .calc_signature = smb2_calc_signature, 5450 5449 .is_read_op = smb2_is_read_op, 5451 5450 .set_oplock_level = smb2_set_oplock_level, 5452 5451 .create_lease_buf = smb2_create_lease_buf, ··· 5549 5550 .get_lease_key = smb2_get_lease_key, 5550 5551 .set_lease_key = smb2_set_lease_key, 5551 5552 .new_lease_key = smb2_new_lease_key, 5552 - .calc_signature = smb2_calc_signature, 5553 5553 .is_read_op = smb21_is_read_op, 5554 5554 .set_oplock_level = smb21_set_oplock_level, 5555 5555 .create_lease_buf = smb2_create_lease_buf, ··· 5658 5660 .set_lease_key = smb2_set_lease_key, 5659 5661 .new_lease_key = smb2_new_lease_key, 5660 5662 .generate_signingkey = generate_smb30signingkey, 5661 - .calc_signature = smb3_calc_signature, 5662 5663 .set_integrity = smb3_set_integrity, 5663 5664 .is_read_op = smb21_is_read_op, 5664 5665 .set_oplock_level = smb3_set_oplock_level, ··· 5774 5777 .set_lease_key = smb2_set_lease_key, 5775 5778 .new_lease_key = smb2_new_lease_key, 5776 5779 .generate_signingkey = generate_smb311signingkey, 5777 - .calc_signature = smb3_calc_signature, 5778 5780 .set_integrity = smb3_set_integrity, 5779 5781 .is_read_op = smb21_is_read_op, 5780 5782 .set_oplock_level = smb3_set_oplock_level,
-6
fs/smb/client/smb2proto.h
··· 39 39 struct TCP_Server_Info *server, struct smb_rqst *rqst); 40 40 extern struct cifs_tcon *smb2_find_smb_tcon(struct TCP_Server_Info *server, 41 41 __u64 ses_id, __u32 tid); 42 - extern int smb2_calc_signature(struct smb_rqst *rqst, 43 - struct TCP_Server_Info *server, 44 - bool allocate_crypto); 45 - extern int smb3_calc_signature(struct smb_rqst *rqst, 46 - struct TCP_Server_Info *server, 47 - bool allocate_crypto); 48 42 extern void smb2_echo_request(struct work_struct *work); 49 43 extern __le32 smb2_get_lease_state(struct cifsInodeInfo *cinode); 50 44 extern bool smb2_is_valid_oplock_break(char *buffer,
+9 -9
fs/smb/client/smb2transport.c
··· 209 209 return tcon; 210 210 } 211 211 212 - int 212 + static int 213 213 smb2_calc_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server, 214 - bool allocate_crypto) 214 + bool allocate_crypto) 215 215 { 216 216 int rc; 217 217 unsigned char smb2_signature[SMB2_HMACSHA256_SIZE]; ··· 465 465 return generate_smb3signingkey(ses, server, &triplet); 466 466 } 467 467 468 - int 468 + static int 469 469 smb3_calc_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server, 470 - bool allocate_crypto) 470 + bool allocate_crypto) 471 471 { 472 472 int rc; 473 473 unsigned char smb3_signature[SMB2_CMACAES_SIZE]; ··· 476 476 struct shash_desc *shash = NULL; 477 477 struct smb_rqst drqst; 478 478 u8 key[SMB3_SIGN_KEY_SIZE]; 479 + 480 + if (server->vals->protocol_id <= SMB21_PROT_ID) 481 + return smb2_calc_signature(rqst, server, allocate_crypto); 479 482 480 483 rc = smb3_get_sign_key(le64_to_cpu(shdr->SessionId), server, key); 481 484 if (unlikely(rc)) { ··· 550 547 static int 551 548 smb2_sign_rqst(struct smb_rqst *rqst, struct TCP_Server_Info *server) 552 549 { 553 - int rc = 0; 554 550 struct smb2_hdr *shdr; 555 551 struct smb2_sess_setup_req *ssr; 556 552 bool is_binding; ··· 576 574 return 0; 577 575 } 578 576 579 - rc = server->ops->calc_signature(rqst, server, false); 580 - 581 - return rc; 577 + return smb3_calc_signature(rqst, server, false); 582 578 } 583 579 584 580 int ··· 612 612 613 613 memset(shdr->Signature, 0, SMB2_SIGNATURE_SIZE); 614 614 615 - rc = server->ops->calc_signature(rqst, server, true); 615 + rc = smb3_calc_signature(rqst, server, true); 616 616 617 617 if (rc) 618 618 return rc;
+23 -13
fs/smb/client/smbdirect.c
··· 1767 1767 struct smbdirect_socket *sc; 1768 1768 struct smbdirect_socket_parameters *sp; 1769 1769 struct rdma_conn_param conn_param; 1770 + struct ib_qp_cap qp_cap; 1770 1771 struct ib_qp_init_attr qp_attr; 1771 1772 struct sockaddr_in *addr_in = (struct sockaddr_in *) dstaddr; 1772 1773 struct ib_port_immutable port_immutable; ··· 1839 1838 goto config_failed; 1840 1839 } 1841 1840 1841 + sp->responder_resources = 1842 + min_t(u8, sp->responder_resources, 1843 + sc->ib.dev->attrs.max_qp_rd_atom); 1844 + log_rdma_mr(INFO, "responder_resources=%d\n", 1845 + sp->responder_resources); 1846 + 1847 + /* 1848 + * We use allocate sp->responder_resources * 2 MRs 1849 + * and each MR needs WRs for REG and INV, so 1850 + * we use '* 4'. 1851 + * 1852 + * +1 for ib_drain_qp() 1853 + */ 1854 + memset(&qp_cap, 0, sizeof(qp_cap)); 1855 + qp_cap.max_send_wr = sp->send_credit_target + sp->responder_resources * 4 + 1; 1856 + qp_cap.max_recv_wr = sp->recv_credit_max + 1; 1857 + qp_cap.max_send_sge = SMBDIRECT_SEND_IO_MAX_SGE; 1858 + qp_cap.max_recv_sge = SMBDIRECT_RECV_IO_MAX_SGE; 1859 + 1842 1860 sc->ib.pd = ib_alloc_pd(sc->ib.dev, 0); 1843 1861 if (IS_ERR(sc->ib.pd)) { 1844 1862 rc = PTR_ERR(sc->ib.pd); ··· 1868 1848 1869 1849 sc->ib.send_cq = 1870 1850 ib_alloc_cq_any(sc->ib.dev, sc, 1871 - sp->send_credit_target, IB_POLL_SOFTIRQ); 1851 + qp_cap.max_send_wr, IB_POLL_SOFTIRQ); 1872 1852 if (IS_ERR(sc->ib.send_cq)) { 1873 1853 sc->ib.send_cq = NULL; 1874 1854 goto alloc_cq_failed; ··· 1876 1856 1877 1857 sc->ib.recv_cq = 1878 1858 ib_alloc_cq_any(sc->ib.dev, sc, 1879 - sp->recv_credit_max, IB_POLL_SOFTIRQ); 1859 + qp_cap.max_recv_wr, IB_POLL_SOFTIRQ); 1880 1860 if (IS_ERR(sc->ib.recv_cq)) { 1881 1861 sc->ib.recv_cq = NULL; 1882 1862 goto alloc_cq_failed; ··· 1885 1865 memset(&qp_attr, 0, sizeof(qp_attr)); 1886 1866 qp_attr.event_handler = smbd_qp_async_error_upcall; 1887 1867 qp_attr.qp_context = sc; 1888 - qp_attr.cap.max_send_wr = sp->send_credit_target; 1889 - qp_attr.cap.max_recv_wr = sp->recv_credit_max; 1890 - qp_attr.cap.max_send_sge = SMBDIRECT_SEND_IO_MAX_SGE; 1891 - qp_attr.cap.max_recv_sge = SMBDIRECT_RECV_IO_MAX_SGE; 1892 - qp_attr.cap.max_inline_data = 0; 1868 + qp_attr.cap = qp_cap; 1893 1869 qp_attr.sq_sig_type = IB_SIGNAL_REQ_WR; 1894 1870 qp_attr.qp_type = IB_QPT_RC; 1895 1871 qp_attr.send_cq = sc->ib.send_cq; ··· 1898 1882 goto create_qp_failed; 1899 1883 } 1900 1884 sc->ib.qp = sc->rdma.cm_id->qp; 1901 - 1902 - sp->responder_resources = 1903 - min_t(u8, sp->responder_resources, 1904 - sc->ib.dev->attrs.max_qp_rd_atom); 1905 - log_rdma_mr(INFO, "responder_resources=%d\n", 1906 - sp->responder_resources); 1907 1885 1908 1886 memset(&conn_param, 0, sizeof(conn_param)); 1909 1887 conn_param.initiator_depth = sp->initiator_depth;
+1
fs/smb/client/trace.c
··· 4 4 * 5 5 * Author(s): Steve French <stfrench@microsoft.com> 6 6 */ 7 + #include "cifsglob.h" 7 8 #define CREATE_TRACE_POINTS 8 9 #include "trace.h"