All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: fs/cifs/dfs_cache.c:1382 __refresh_tcon() warn: passing a valid pointer to 'PTR_ERR'
Date: Tue, 16 Nov 2021 01:02:20 +0800	[thread overview]
Message-ID: <202111160111.gyXMBGAf-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 6398 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Paulo Alcantara <pc@cjr.nz>
CC: Steve French <stfrench@microsoft.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   8ab774587903771821b59471cc723bba6d893942
commit: c88f7dcd6d6429197fc2fd87b54a894ffcd48e8e cifs: support nested dfs links over reconnect
date:   5 days ago
:::::: branch date: 14 hours ago
:::::: commit date: 5 days ago
config: xtensa-randconfig-m031-20211115 (attached as .config)
compiler: xtensa-linux-gcc (GCC) 11.2.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

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

Old smatch warnings:
arch/xtensa/include/asm/thread_info.h:91 current_thread_info() warn: inconsistent indenting
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 <pc@cjr.nz>
:::::: CC: Steve French <stfrench@microsoft.com>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 33635 bytes --]

             reply	other threads:[~2021-11-15 17:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-15 17:02 kernel test robot [this message]
2022-02-11 22:46 fs/cifs/dfs_cache.c:1382 __refresh_tcon() warn: passing a valid pointer to 'PTR_ERR' kernel test robot
2022-09-19  2:45 kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202111160111.gyXMBGAf-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.