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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   521a547ced6477c54b4b0cc206000406c221b4d6
commit: c88f7dcd6d6429197fc2fd87b54a894ffcd48e8e cifs: support nested dfs links 
over reconnect
date:   10 months ago
:::::: branch date: 6 hours ago
:::::: commit date: 10 months ago
config: csky-randconfig-m041-20220918 
(https://download.01.org/0day-ci/archive/20220919/[email protected]/config)
compiler: csky-linux-gcc (GCC) 12.1.0

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

New smatch warnings:
fs/cifs/dfs_cache.c:1382 __refresh_tcon() warn: passing a valid pointer to 
'PTR_ERR'

Old smatch warnings:
arch/csky/include/asm/uaccess.h:202 __get_user_fn() error: uninitialized symbol 
'retval'.
fs/cifs/dfs_cache.c:509 copy_ref_data() warn: passing a valid pointer to 
'PTR_ERR'

vim +/PTR_ERR +1382 fs/cifs/dfs_cache.c

5072010ccf0592 Paulo Alcantara (SUSE  2019-03-19  1365) 
b62366181a5e94 Paulo Alcantara        2021-07-16  1366  /* Refresh dfs referral 
of tcon and mark it for reconnect if needed */
c88f7dcd6d6429 Paulo Alcantara        2021-11-03  1367  static int 
__refresh_tcon(const char *path, struct cifs_ses **sessions, struct cifs_tcon 
*tcon,
c88f7dcd6d6429 Paulo Alcantara        2021-11-03  1368                          
  bool force_refresh)
b62366181a5e94 Paulo Alcantara        2021-07-16  1369  {
b62366181a5e94 Paulo Alcantara        2021-07-16  1370          struct cifs_ses 
*ses;
1023e90b733acd Paulo Alcantara        2021-06-08  1371          struct 
cache_entry *ce;
1023e90b733acd Paulo Alcantara        2021-06-08  1372          struct 
dfs_info3_param *refs = NULL;
1023e90b733acd Paulo Alcantara        2021-06-08  1373          int numrefs = 0;
1023e90b733acd Paulo Alcantara        2021-06-08  1374          bool 
needs_refresh = false;
b62366181a5e94 Paulo Alcantara        2021-07-16  1375          struct 
dfs_cache_tgt_list tl = DFS_CACHE_TGT_LIST_INIT(tl);
c9f71103990591 Paulo Alcantara        2021-06-04  1376          int rc = 0;
b62366181a5e94 Paulo Alcantara        2021-07-16  1377          unsigned int 
xid;
1023e90b733acd Paulo Alcantara        2021-06-08  1378  
c9f71103990591 Paulo Alcantara        2021-06-04  1379          ses = 
find_ipc_from_server_path(sessions, path);
b62366181a5e94 Paulo Alcantara        2021-07-16  1380          if 
(IS_ERR(ses)) {
b62366181a5e94 Paulo Alcantara        2021-07-16  1381                  
cifs_dbg(FYI, "%s: could not find ipc session\n", __func__);
b62366181a5e94 Paulo Alcantara        2021-07-16 @1382                  return 
PTR_ERR(ses);
b62366181a5e94 Paulo Alcantara        2021-07-16  1383          }
1023e90b733acd Paulo Alcantara        2021-06-08  1384  
1023e90b733acd Paulo Alcantara        2021-06-08  1385          
down_read(&htable_rw_lock);
1023e90b733acd Paulo Alcantara        2021-06-08  1386          ce = 
lookup_cache_entry(path);
b62366181a5e94 Paulo Alcantara        2021-07-16  1387          needs_refresh = 
force_refresh || IS_ERR(ce) || cache_entry_expired(ce);
b62366181a5e94 Paulo Alcantara        2021-07-16  1388          if 
(!IS_ERR(ce)) {
b62366181a5e94 Paulo Alcantara        2021-07-16  1389                  rc = 
get_targets(ce, &tl);
b62366181a5e94 Paulo Alcantara        2021-07-16  1390                  if (rc)
b62366181a5e94 Paulo Alcantara        2021-07-16  1391                          
cifs_dbg(FYI, "%s: could not get dfs targets: %d\n", __func__, rc);
b62366181a5e94 Paulo Alcantara        2021-07-16  1392          }
1023e90b733acd Paulo Alcantara        2021-06-08  1393          
up_read(&htable_rw_lock);
1023e90b733acd Paulo Alcantara        2021-06-08  1394  
b62366181a5e94 Paulo Alcantara        2021-07-16  1395          if 
(!needs_refresh) {
b62366181a5e94 Paulo Alcantara        2021-07-16  1396                  rc = 0;
b62366181a5e94 Paulo Alcantara        2021-07-16  1397                  goto 
out;
b62366181a5e94 Paulo Alcantara        2021-07-16  1398          }
1023e90b733acd Paulo Alcantara        2021-06-08  1399  
c9f71103990591 Paulo Alcantara        2021-06-04  1400          xid = get_xid();
1023e90b733acd Paulo Alcantara        2021-06-08  1401          rc = 
get_dfs_referral(xid, ses, path, &refs, &numrefs);
c9f71103990591 Paulo Alcantara        2021-06-04  1402          free_xid(xid);
1023e90b733acd Paulo Alcantara        2021-06-08  1403  
1023e90b733acd Paulo Alcantara        2021-06-08  1404          /* Create or 
update a cache entry with the new referral */
1023e90b733acd Paulo Alcantara        2021-06-08  1405          if (!rc) {
b62366181a5e94 Paulo Alcantara        2021-07-16  1406                  
dump_refs(refs, numrefs);
b62366181a5e94 Paulo Alcantara        2021-07-16  1407  
1023e90b733acd Paulo Alcantara        2021-06-08  1408                  
down_write(&htable_rw_lock);
1023e90b733acd Paulo Alcantara        2021-06-08  1409                  ce = 
lookup_cache_entry(path);
1023e90b733acd Paulo Alcantara        2021-06-08  1410                  if 
(IS_ERR(ce))
1023e90b733acd Paulo Alcantara        2021-06-08  1411                          
add_cache_entry_locked(refs, numrefs);
b62366181a5e94 Paulo Alcantara        2021-07-16  1412                  else if 
(force_refresh || cache_entry_expired(ce))
1023e90b733acd Paulo Alcantara        2021-06-08  1413                          
update_cache_entry_locked(ce, refs, numrefs);
1023e90b733acd Paulo Alcantara        2021-06-08  1414                  
up_write(&htable_rw_lock);
b62366181a5e94 Paulo Alcantara        2021-07-16  1415  
b62366181a5e94 Paulo Alcantara        2021-07-16  1416                  
mark_for_reconnect_if_needed(tcon, &tl, refs, numrefs);
345c1a4a9e09dc Paulo Alcantara (SUSE  2019-12-04  1417)         }
1023e90b733acd Paulo Alcantara        2021-06-08  1418  
b62366181a5e94 Paulo Alcantara        2021-07-16  1419  out:
b62366181a5e94 Paulo Alcantara        2021-07-16  1420          
dfs_cache_free_tgts(&tl);
1023e90b733acd Paulo Alcantara        2021-06-08  1421          
free_dfs_info_array(refs, numrefs);
b62366181a5e94 Paulo Alcantara        2021-07-16  1422          return rc;
b62366181a5e94 Paulo Alcantara        2021-07-16  1423  }
b62366181a5e94 Paulo Alcantara        2021-07-16  1424  

:::::: The code at line 1382 was first introduced by commit
:::::: b62366181a5e9473e9c10e98f400049491c55876 cifs: support share failover 
when remounting

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

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to