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 '5.16-rc1-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6

Pull cifs fixes from Steve French:
"Three small cifs/smb3 fixes: two to address minor coverity issues and
one cleanup"

* tag '5.16-rc1-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6:
cifs: introduce cifs_ses_mark_for_reconnect() helper
cifs: protect srv_count with cifs_tcp_ses_lock
cifs: move debug print out of spinlock

+21 -34
+2 -14
fs/cifs/cifs_swn.c
··· 393 393 394 394 static int cifs_swn_resource_state_changed(struct cifs_swn_reg *swnreg, const char *name, int state) 395 395 { 396 - int i; 397 - 398 396 switch (state) { 399 397 case CIFS_SWN_RESOURCE_STATE_UNAVAILABLE: 400 398 cifs_dbg(FYI, "%s: resource name '%s' become unavailable\n", __func__, name); 401 - for (i = 0; i < swnreg->tcon->ses->chan_count; i++) { 402 - spin_lock(&GlobalMid_Lock); 403 - if (swnreg->tcon->ses->chans[i].server->tcpStatus != CifsExiting) 404 - swnreg->tcon->ses->chans[i].server->tcpStatus = CifsNeedReconnect; 405 - spin_unlock(&GlobalMid_Lock); 406 - } 399 + cifs_ses_mark_for_reconnect(swnreg->tcon->ses); 407 400 break; 408 401 case CIFS_SWN_RESOURCE_STATE_AVAILABLE: 409 402 cifs_dbg(FYI, "%s: resource name '%s' become available\n", __func__, name); 410 - for (i = 0; i < swnreg->tcon->ses->chan_count; i++) { 411 - spin_lock(&GlobalMid_Lock); 412 - if (swnreg->tcon->ses->chans[i].server->tcpStatus != CifsExiting) 413 - swnreg->tcon->ses->chans[i].server->tcpStatus = CifsNeedReconnect; 414 - spin_unlock(&GlobalMid_Lock); 415 - } 403 + cifs_ses_mark_for_reconnect(swnreg->tcon->ses); 416 404 break; 417 405 case CIFS_SWN_RESOURCE_STATE_UNKNOWN: 418 406 cifs_dbg(FYI, "%s: resource name '%s' changed to unknown state\n", __func__, name);
+1
fs/cifs/cifsproto.h
··· 599 599 bool is_server_using_iface(struct TCP_Server_Info *server, 600 600 struct cifs_server_iface *iface); 601 601 bool is_ses_using_iface(struct cifs_ses *ses, struct cifs_server_iface *iface); 602 + void cifs_ses_mark_for_reconnect(struct cifs_ses *ses); 602 603 603 604 void extract_unc_hostname(const char *unc, const char **h, size_t *len); 604 605 int copy_path_name(char *dst, const char *src);
+3 -13
fs/cifs/connect.c
··· 1452 1452 tcp_ses->max_in_flight = 0; 1453 1453 tcp_ses->credits = 1; 1454 1454 if (primary_server) { 1455 + spin_lock(&cifs_tcp_ses_lock); 1455 1456 ++primary_server->srv_count; 1456 1457 tcp_ses->primary_server = primary_server; 1458 + spin_unlock(&cifs_tcp_ses_lock); 1457 1459 } 1458 1460 init_waitqueue_head(&tcp_ses->response_q); 1459 1461 init_waitqueue_head(&tcp_ses->request_q); ··· 4113 4111 } 4114 4112 4115 4113 #ifdef CONFIG_CIFS_DFS_UPCALL 4116 - static void mark_tcon_tcp_ses_for_reconnect(struct cifs_tcon *tcon) 4117 - { 4118 - int i; 4119 - 4120 - for (i = 0; i < tcon->ses->chan_count; i++) { 4121 - spin_lock(&GlobalMid_Lock); 4122 - if (tcon->ses->chans[i].server->tcpStatus != CifsExiting) 4123 - tcon->ses->chans[i].server->tcpStatus = CifsNeedReconnect; 4124 - spin_unlock(&GlobalMid_Lock); 4125 - } 4126 - } 4127 - 4128 4114 /* Update dfs referral path of superblock */ 4129 4115 static int update_server_fullpath(struct TCP_Server_Info *server, struct cifs_sb_info *cifs_sb, 4130 4116 const char *target) ··· 4289 4299 */ 4290 4300 if (rc && server->current_fullpath != server->origin_fullpath) { 4291 4301 server->current_fullpath = server->origin_fullpath; 4292 - mark_tcon_tcp_ses_for_reconnect(tcon); 4302 + cifs_ses_mark_for_reconnect(tcon->ses); 4293 4303 } 4294 4304 4295 4305 dfs_cache_free_tgts(tl);
+1 -6
fs/cifs/dfs_cache.c
··· 1355 1355 } 1356 1356 1357 1357 cifs_dbg(FYI, "%s: no cached or matched targets. mark dfs share for reconnect.\n", __func__); 1358 - for (i = 0; i < tcon->ses->chan_count; i++) { 1359 - spin_lock(&GlobalMid_Lock); 1360 - if (tcon->ses->chans[i].server->tcpStatus != CifsExiting) 1361 - tcon->ses->chans[i].server->tcpStatus = CifsNeedReconnect; 1362 - spin_unlock(&GlobalMid_Lock); 1363 - } 1358 + cifs_ses_mark_for_reconnect(tcon->ses); 1364 1359 } 1365 1360 1366 1361 /* Refresh dfs referral of tcon and mark it for reconnect if needed */
+14 -1
fs/cifs/sess.c
··· 95 95 } 96 96 97 97 if (!(ses->server->capabilities & SMB2_GLOBAL_CAP_MULTI_CHANNEL)) { 98 - cifs_dbg(VFS, "server %s does not support multichannel\n", ses->server->hostname); 99 98 ses->chan_max = 1; 100 99 spin_unlock(&ses->chan_lock); 100 + cifs_dbg(VFS, "server %s does not support multichannel\n", ses->server->hostname); 101 101 return 0; 102 102 } 103 103 spin_unlock(&ses->chan_lock); ··· 316 316 cifs_put_tcp_session(chan->server, 0); 317 317 318 318 return rc; 319 + } 320 + 321 + /* Mark all session channels for reconnect */ 322 + void cifs_ses_mark_for_reconnect(struct cifs_ses *ses) 323 + { 324 + int i; 325 + 326 + for (i = 0; i < ses->chan_count; i++) { 327 + spin_lock(&GlobalMid_Lock); 328 + if (ses->chans[i].server->tcpStatus != CifsExiting) 329 + ses->chans[i].server->tcpStatus = CifsNeedReconnect; 330 + spin_unlock(&GlobalMid_Lock); 331 + } 319 332 } 320 333 321 334 static __u32 cifs_ssetup_hdr(struct cifs_ses *ses, SESSION_SETUP_ANDX *pSMB)