CC: [email protected]
CC: [email protected]
TO: Shyam Prasad N <[email protected]>
CC: Steve French <[email protected]>
CC: "Paulo Alcantara (SUSE)" <[email protected]>
CC: Pavel Shilovsky <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   5ffe04ccd69ae56af304ff7f98fbdaa4478ed47e
commit: 4e456b30f78c429b183db420e23b26cde7e03a78 cifs: On cifs_reconnect, 
resolve the hostname again.
date:   11 days ago
:::::: branch date: 2 hours ago
:::::: commit date: 11 days ago
config: i386-randconfig-m021-20210419 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>
Reported-by: Dan Carpenter <[email protected]>

New smatch warnings:
fs/cifs/connect.c:375 cifs_reconnect() error: we previously assumed 'cifs_sb' 
could be null (see line 324)

Old smatch warnings:
fs/cifs/connect.c:2568 generic_ip_connect() error: we previously assumed 
'socket' could be null (see line 2556)
fs/cifs/connect.c:3509 cifs_mount() error: we previously assumed 'tcon' could 
be null (see line 3470)

vim +/cifs_sb +375 fs/cifs/connect.c

121d947d4fe15b Samuel Cabrero         2020-11-30  322  
aaa3aef34d3ab9 Paulo Alcantara        2020-05-19  323  #ifdef 
CONFIG_CIFS_DFS_UPCALL
4e456b30f78c42 Shyam Prasad N         2021-03-31 @324           if (cifs_sb && 
cifs_sb->origin_fullpath)
93d5cb517db39e Paulo Alcantara        2018-11-14  325                   /*
93d5cb517db39e Paulo Alcantara        2018-11-14  326                    * Set 
up next DFS target server (if any) for reconnect. If DFS
93d5cb517db39e Paulo Alcantara        2018-11-14  327                    * 
feature is disabled, then we will retry last server we
93d5cb517db39e Paulo Alcantara        2018-11-14  328                    * 
connected to before.
93d5cb517db39e Paulo Alcantara        2018-11-14  329                    */
7d397a034d5c45 Paulo Alcantara        2020-07-21  330                   
reconn_set_next_dfs_target(server, cifs_sb, &tgt_list, &tgt_it);
4e456b30f78c42 Shyam Prasad N         2021-03-31  331           else {
4e456b30f78c42 Shyam Prasad N         2021-03-31  332  #endif
4e456b30f78c42 Shyam Prasad N         2021-03-31  333                   /*
4e456b30f78c42 Shyam Prasad N         2021-03-31  334                    * 
Resolve the hostname again to make sure that IP address is up-to-date.
4e456b30f78c42 Shyam Prasad N         2021-03-31  335                    */
4e456b30f78c42 Shyam Prasad N         2021-03-31  336                   rc = 
reconn_set_ipaddr_from_hostname(server);
4e456b30f78c42 Shyam Prasad N         2021-03-31  337                   if (rc) 
{
4e456b30f78c42 Shyam Prasad N         2021-03-31  338                           
cifs_dbg(FYI, "%s: failed to resolve hostname: %d\n",
4e456b30f78c42 Shyam Prasad N         2021-03-31  339                           
                __func__, rc);
4e456b30f78c42 Shyam Prasad N         2021-03-31  340                   }
4e456b30f78c42 Shyam Prasad N         2021-03-31  341  
4e456b30f78c42 Shyam Prasad N         2021-03-31  342  #ifdef 
CONFIG_CIFS_DFS_UPCALL
4e456b30f78c42 Shyam Prasad N         2021-03-31  343           }
93d5cb517db39e Paulo Alcantara        2018-11-14  344  #endif
aaa3aef34d3ab9 Paulo Alcantara        2020-05-19  345  
4e456b30f78c42 Shyam Prasad N         2021-03-31  346  
121d947d4fe15b Samuel Cabrero         2020-11-30  347  #ifdef 
CONFIG_CIFS_SWN_UPCALL
121d947d4fe15b Samuel Cabrero         2020-11-30  348           }
121d947d4fe15b Samuel Cabrero         2020-11-30  349  #endif
121d947d4fe15b Samuel Cabrero         2020-11-30  350  
aaa3aef34d3ab9 Paulo Alcantara        2020-05-19  351           if 
(cifs_rdma_enabled(server))
aaa3aef34d3ab9 Paulo Alcantara        2020-05-19  352                   rc = 
smbd_reconnect(server);
aaa3aef34d3ab9 Paulo Alcantara        2020-05-19  353           else
aaa3aef34d3ab9 Paulo Alcantara        2020-05-19  354                   rc = 
generic_ip_connect(server);
aaa3aef34d3ab9 Paulo Alcantara        2020-05-19  355           if (rc) {
aaa3aef34d3ab9 Paulo Alcantara        2020-05-19  356                   
cifs_dbg(FYI, "reconnect error %d\n", rc);
4afe260bab5029 Federico Sauter        2015-03-17  357                   
mutex_unlock(&server->srv_mutex);
0cb766ae629c70 Steve French           2005-04-28  358                   
msleep(3000);
^1da177e4c3f41 Linus Torvalds         2005-04-16  359           } else {
^1da177e4c3f41 Linus Torvalds         2005-04-16  360                   
atomic_inc(&tcpSesReconnectCount);
335b7b62ffb69d Pavel Shilovsky        2019-01-16  361                   
set_credits(server, 1);
^1da177e4c3f41 Linus Torvalds         2005-04-16  362                   
spin_lock(&GlobalMid_Lock);
469ee614aaa367 Jeff Layton            2008-10-16  363                   if 
(server->tcpStatus != CifsExiting)
fd88ce9313e9f9 Steve French           2011-04-12  364                           
server->tcpStatus = CifsNeedNegotiate;
^1da177e4c3f41 Linus Torvalds         2005-04-16  365                   
spin_unlock(&GlobalMid_Lock);
121d947d4fe15b Samuel Cabrero         2020-11-30  366  #ifdef 
CONFIG_CIFS_SWN_UPCALL
121d947d4fe15b Samuel Cabrero         2020-11-30  367                   
server->use_swn_dstaddr = false;
121d947d4fe15b Samuel Cabrero         2020-11-30  368  #endif
73e216a8a42c0e Jeff Layton            2013-09-05  369                   
mutex_unlock(&server->srv_mutex);
4afe260bab5029 Federico Sauter        2015-03-17  370           }
7fdbaa1b8daa10 Jeff Layton            2011-06-10  371   } while 
(server->tcpStatus == CifsNeedReconnect);
2b84a36c5529da Jeff Layton            2011-01-11  372  
93d5cb517db39e Paulo Alcantara        2018-11-14  373  #ifdef 
CONFIG_CIFS_DFS_UPCALL
93d5cb517db39e Paulo Alcantara        2018-11-14  374   if (tgt_it) {
93d5cb517db39e Paulo Alcantara        2018-11-14 @375           rc = 
dfs_cache_noreq_update_tgthint(cifs_sb->origin_fullpath + 1,
93d5cb517db39e Paulo Alcantara        2018-11-14  376                           
                    tgt_it);
93d5cb517db39e Paulo Alcantara        2018-11-14  377           if (rc) {
afe6f65353b644 Ronnie Sahlberg        2019-08-28  378                   
cifs_server_dbg(VFS, "%s: failed to update DFS target hint: rc = %d\n",
93d5cb517db39e Paulo Alcantara        2018-11-14  379                           
 __func__, rc);
93d5cb517db39e Paulo Alcantara        2018-11-14  380           }
93d5cb517db39e Paulo Alcantara        2018-11-14  381           rc = 
dfs_cache_update_vol(cifs_sb->origin_fullpath, server);
93d5cb517db39e Paulo Alcantara        2018-11-14  382           if (rc) {
afe6f65353b644 Ronnie Sahlberg        2019-08-28  383                   
cifs_server_dbg(VFS, "%s: failed to update vol info in DFS cache: rc = %d\n",
93d5cb517db39e Paulo Alcantara        2018-11-14  384                           
 __func__, rc);
93d5cb517db39e Paulo Alcantara        2018-11-14  385           }
93d5cb517db39e Paulo Alcantara        2018-11-14  386           
dfs_cache_free_tgts(&tgt_list);
8354d88efdab72 Paulo Alcantara (SUSE  2019-11-22  387) 
23324407143dd9 Paulo Alcantara        2018-11-20  388   }
8354d88efdab72 Paulo Alcantara (SUSE  2019-11-22  389) 
bacd704a95ad0b Paulo Alcantara (SUSE  2020-02-20  390)  cifs_put_tcp_super(sb);
93d5cb517db39e Paulo Alcantara        2018-11-14  391  #endif
b8c600120fc87d Sachin Prabhu          2016-10-20  392   if (server->tcpStatus 
== CifsNeedNegotiate)
b8c600120fc87d Sachin Prabhu          2016-10-20  393           
mod_delayed_work(cifsiod_wq, &server->echo, 0);
b8c600120fc87d Sachin Prabhu          2016-10-20  394  
e2e87519bd72e2 Stefan Metzmacher      2020-02-24  395   
wake_up(&server->response_q);
^1da177e4c3f41 Linus Torvalds         2005-04-16  396   return rc;
^1da177e4c3f41 Linus Torvalds         2005-04-16  397  }
^1da177e4c3f41 Linus Torvalds         2005-04-16  398  

:::::: The code at line 375 was first introduced by commit
:::::: 93d5cb517db39e8af8d1292f9e785e4983b7f708 cifs: Add support for failover 
in cifs_reconnect()

:::::: TO: Paulo Alcantara <[email protected]>
:::::: CC: Steve French <[email protected]>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]

Attachment: .config.gz
Description: application/gzip

_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to