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: Sat, 12 Feb 2022 06:46:12 +0800 [thread overview]
Message-ID: <202202120615.vNPjJ9hn-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 6528 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: f1baf68e1383f6ed93eb9cff2866d46562607a43
commit: c88f7dcd6d6429197fc2fd87b54a894ffcd48e8e cifs: support nested dfs links over reconnect
date: 3 months ago
:::::: branch date: 23 hours ago
:::::: commit date: 3 months ago
config: arc-randconfig-m031-20220211 (https://download.01.org/0day-ci/archive/20220212/202202120615.vNPjJ9hn-lkp(a)intel.com/config)
compiler: arc-elf-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/arc/include/asm/thread_info.h:65 current_thread_info() error: uninitialized symbol 'sp'.
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
5072010ccf05929 Paulo Alcantara (SUSE 2019-03-19 1365)
b62366181a5e947 Paulo Alcantara 2021-07-16 1366 /* Refresh dfs referral of tcon and mark it for reconnect if needed */
c88f7dcd6d64291 Paulo Alcantara 2021-11-03 1367 static int __refresh_tcon(const char *path, struct cifs_ses **sessions, struct cifs_tcon *tcon,
c88f7dcd6d64291 Paulo Alcantara 2021-11-03 1368 bool force_refresh)
b62366181a5e947 Paulo Alcantara 2021-07-16 1369 {
b62366181a5e947 Paulo Alcantara 2021-07-16 1370 struct cifs_ses *ses;
1023e90b733acd1 Paulo Alcantara 2021-06-08 1371 struct cache_entry *ce;
1023e90b733acd1 Paulo Alcantara 2021-06-08 1372 struct dfs_info3_param *refs = NULL;
1023e90b733acd1 Paulo Alcantara 2021-06-08 1373 int numrefs = 0;
1023e90b733acd1 Paulo Alcantara 2021-06-08 1374 bool needs_refresh = false;
b62366181a5e947 Paulo Alcantara 2021-07-16 1375 struct dfs_cache_tgt_list tl = DFS_CACHE_TGT_LIST_INIT(tl);
c9f711039905910 Paulo Alcantara 2021-06-04 1376 int rc = 0;
b62366181a5e947 Paulo Alcantara 2021-07-16 1377 unsigned int xid;
1023e90b733acd1 Paulo Alcantara 2021-06-08 1378
c9f711039905910 Paulo Alcantara 2021-06-04 1379 ses = find_ipc_from_server_path(sessions, path);
b62366181a5e947 Paulo Alcantara 2021-07-16 1380 if (IS_ERR(ses)) {
b62366181a5e947 Paulo Alcantara 2021-07-16 1381 cifs_dbg(FYI, "%s: could not find ipc session\n", __func__);
b62366181a5e947 Paulo Alcantara 2021-07-16 @1382 return PTR_ERR(ses);
b62366181a5e947 Paulo Alcantara 2021-07-16 1383 }
1023e90b733acd1 Paulo Alcantara 2021-06-08 1384
1023e90b733acd1 Paulo Alcantara 2021-06-08 1385 down_read(&htable_rw_lock);
1023e90b733acd1 Paulo Alcantara 2021-06-08 1386 ce = lookup_cache_entry(path);
b62366181a5e947 Paulo Alcantara 2021-07-16 1387 needs_refresh = force_refresh || IS_ERR(ce) || cache_entry_expired(ce);
b62366181a5e947 Paulo Alcantara 2021-07-16 1388 if (!IS_ERR(ce)) {
b62366181a5e947 Paulo Alcantara 2021-07-16 1389 rc = get_targets(ce, &tl);
b62366181a5e947 Paulo Alcantara 2021-07-16 1390 if (rc)
b62366181a5e947 Paulo Alcantara 2021-07-16 1391 cifs_dbg(FYI, "%s: could not get dfs targets: %d\n", __func__, rc);
b62366181a5e947 Paulo Alcantara 2021-07-16 1392 }
1023e90b733acd1 Paulo Alcantara 2021-06-08 1393 up_read(&htable_rw_lock);
1023e90b733acd1 Paulo Alcantara 2021-06-08 1394
b62366181a5e947 Paulo Alcantara 2021-07-16 1395 if (!needs_refresh) {
b62366181a5e947 Paulo Alcantara 2021-07-16 1396 rc = 0;
b62366181a5e947 Paulo Alcantara 2021-07-16 1397 goto out;
b62366181a5e947 Paulo Alcantara 2021-07-16 1398 }
1023e90b733acd1 Paulo Alcantara 2021-06-08 1399
c9f711039905910 Paulo Alcantara 2021-06-04 1400 xid = get_xid();
1023e90b733acd1 Paulo Alcantara 2021-06-08 1401 rc = get_dfs_referral(xid, ses, path, &refs, &numrefs);
c9f711039905910 Paulo Alcantara 2021-06-04 1402 free_xid(xid);
1023e90b733acd1 Paulo Alcantara 2021-06-08 1403
1023e90b733acd1 Paulo Alcantara 2021-06-08 1404 /* Create or update a cache entry with the new referral */
1023e90b733acd1 Paulo Alcantara 2021-06-08 1405 if (!rc) {
b62366181a5e947 Paulo Alcantara 2021-07-16 1406 dump_refs(refs, numrefs);
b62366181a5e947 Paulo Alcantara 2021-07-16 1407
1023e90b733acd1 Paulo Alcantara 2021-06-08 1408 down_write(&htable_rw_lock);
1023e90b733acd1 Paulo Alcantara 2021-06-08 1409 ce = lookup_cache_entry(path);
1023e90b733acd1 Paulo Alcantara 2021-06-08 1410 if (IS_ERR(ce))
1023e90b733acd1 Paulo Alcantara 2021-06-08 1411 add_cache_entry_locked(refs, numrefs);
b62366181a5e947 Paulo Alcantara 2021-07-16 1412 else if (force_refresh || cache_entry_expired(ce))
1023e90b733acd1 Paulo Alcantara 2021-06-08 1413 update_cache_entry_locked(ce, refs, numrefs);
1023e90b733acd1 Paulo Alcantara 2021-06-08 1414 up_write(&htable_rw_lock);
b62366181a5e947 Paulo Alcantara 2021-07-16 1415
b62366181a5e947 Paulo Alcantara 2021-07-16 1416 mark_for_reconnect_if_needed(tcon, &tl, refs, numrefs);
345c1a4a9e09dc5 Paulo Alcantara (SUSE 2019-12-04 1417) }
1023e90b733acd1 Paulo Alcantara 2021-06-08 1418
b62366181a5e947 Paulo Alcantara 2021-07-16 1419 out:
b62366181a5e947 Paulo Alcantara 2021-07-16 1420 dfs_cache_free_tgts(&tl);
1023e90b733acd1 Paulo Alcantara 2021-06-08 1421 free_dfs_info_array(refs, numrefs);
b62366181a5e947 Paulo Alcantara 2021-07-16 1422 return rc;
b62366181a5e947 Paulo Alcantara 2021-07-16 1423 }
b62366181a5e947 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
next reply other threads:[~2022-02-11 22:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-11 22:46 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-09-19 2:45 fs/cifs/dfs_cache.c:1382 __refresh_tcon() warn: passing a valid pointer to 'PTR_ERR' kernel test robot
2021-11-15 17:02 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=202202120615.vNPjJ9hn-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.