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

Pull smb client fixes from Steve French:
"Five smb3 client fixes, mostly multichannel related:

- four multichannel fixes including fix for channel allocation when
multiple inactive channels, fix for unneeded race in channel
deallocation, correct redundant channel scaling, and redundant
multichannel disabling scenarios

- add warning if max compound requests reached"

* tag 'v6.8-rc3-smb-client-fixes' of git://git.samba.org/sfrench/cifs-2.6:
smb: client: increase number of PDUs allowed in a compound request
cifs: failure to add channel on iface should bump up weight
cifs: do not search for channel if server is terminating
cifs: avoid redundant calls to disable multichannel
cifs: make sure that channel scaling is done only once

+31 -8
+4 -1
fs/smb/client/cifsglob.h
··· 87 87 #define SMB_INTERFACE_POLL_INTERVAL 600 88 88 89 89 /* maximum number of PDUs in one compound */ 90 - #define MAX_COMPOUND 5 90 + #define MAX_COMPOUND 7 91 91 92 92 /* 93 93 * Default number of credits to keep available for SMB3. ··· 1032 1032 __u8 signkey[SMB3_SIGN_KEY_SIZE]; 1033 1033 }; 1034 1034 1035 + #define CIFS_SES_FLAG_SCALE_CHANNELS (0x1) 1036 + 1035 1037 /* 1036 1038 * Session structure. One of these for each uid session with a particular host 1037 1039 */ ··· 1066 1064 enum securityEnum sectype; /* what security flavor was specified? */ 1067 1065 bool sign; /* is signing required? */ 1068 1066 bool domainAuto:1; 1067 + unsigned int flags; 1069 1068 __u16 session_flags; 1070 1069 __u8 smb3signingkey[SMB3_SIGN_KEY_SIZE]; 1071 1070 __u8 smb3encryptionkey[SMB3_ENC_DEC_KEY_SIZE];
+6
fs/smb/client/sess.c
··· 75 75 { 76 76 unsigned int i; 77 77 78 + /* if the channel is waiting for termination */ 79 + if (server->terminate) 80 + return CIFS_INVAL_CHAN_INDEX; 81 + 78 82 for (i = 0; i < ses->chan_count; i++) { 79 83 if (ses->chans[i].server == server) 80 84 return i; ··· 273 269 &iface->sockaddr, 274 270 rc); 275 271 kref_put(&iface->refcount, release_iface); 272 + /* failure to add chan should increase weight */ 273 + iface->weight_fulfilled++; 276 274 continue; 277 275 } 278 276
+19 -5
fs/smb/client/smb2pdu.c
··· 178 178 } 179 179 180 180 ses->chans[chan_index].server = NULL; 181 + server->terminate = true; 181 182 spin_unlock(&ses->chan_lock); 182 183 183 184 /* ··· 189 188 */ 190 189 cifs_put_tcp_session(server, from_reconnect); 191 190 192 - server->terminate = true; 193 191 cifs_signal_cifsd_for_reconnect(server, false); 194 192 195 193 /* mark primary server as needing reconnect */ ··· 399 399 goto out; 400 400 } 401 401 402 + spin_lock(&ses->ses_lock); 403 + if (ses->flags & CIFS_SES_FLAG_SCALE_CHANNELS) { 404 + spin_unlock(&ses->ses_lock); 405 + mutex_unlock(&ses->session_mutex); 406 + goto skip_add_channels; 407 + } 408 + ses->flags |= CIFS_SES_FLAG_SCALE_CHANNELS; 409 + spin_unlock(&ses->ses_lock); 410 + 402 411 if (!rc && 403 412 (server->capabilities & SMB2_GLOBAL_CAP_MULTI_CHANNEL)) { 404 413 mutex_unlock(&ses->session_mutex); ··· 419 410 rc = SMB3_request_interfaces(xid, tcon, false); 420 411 free_xid(xid); 421 412 422 - if (rc == -EOPNOTSUPP) { 413 + if (rc == -EOPNOTSUPP && ses->chan_count > 1) { 423 414 /* 424 415 * some servers like Azure SMB server do not advertise 425 416 * that multichannel has been disabled with server ··· 437 428 if (ses->chan_max > ses->chan_count && 438 429 ses->iface_count && 439 430 !SERVER_IS_CHAN(server)) { 440 - if (ses->chan_count == 1) 431 + if (ses->chan_count == 1) { 441 432 cifs_server_dbg(VFS, "supports multichannel now\n"); 433 + queue_delayed_work(cifsiod_wq, &tcon->query_interfaces, 434 + (SMB_INTERFACE_POLL_INTERVAL * HZ)); 435 + } 442 436 443 437 cifs_try_adding_channels(ses); 444 - queue_delayed_work(cifsiod_wq, &tcon->query_interfaces, 445 - (SMB_INTERFACE_POLL_INTERVAL * HZ)); 446 438 } 447 439 } else { 448 440 mutex_unlock(&ses->session_mutex); 449 441 } 442 + 450 443 skip_add_channels: 444 + spin_lock(&ses->ses_lock); 445 + ses->flags &= ~CIFS_SES_FLAG_SCALE_CHANNELS; 446 + spin_unlock(&ses->ses_lock); 451 447 452 448 if (smb2_command != SMB2_INTERNAL_CMD) 453 449 mod_delayed_work(cifsiod_wq, &server->reconnect, 0);
+2 -2
fs/smb/client/transport.c
··· 435 435 if (!(flags & CIFS_TRANSFORM_REQ)) 436 436 return __smb_send_rqst(server, num_rqst, rqst); 437 437 438 - if (num_rqst > MAX_COMPOUND - 1) 439 - return -ENOMEM; 438 + if (WARN_ON_ONCE(num_rqst > MAX_COMPOUND - 1)) 439 + return -EIO; 440 440 441 441 if (!server->ops->init_transform_rq) { 442 442 cifs_server_dbg(VFS, "Encryption requested but transform callback is missing\n");