[linux-nvme:nvme-7.3 45/48] drivers/nvme/host/multipath.c:249:38: warning: reading variable 'current_path' requires holding __ctx_lock_RCU 'RCU'

kernel test robot <[email protected]> Wed, 29 Jul 2026 16:36:21 +0800
Newsgroups dev.linux.lists.oe-kbuild
Message-ID <[email protected]>
:::::: 
:::::: Manual check reason: "only suspicious fbc files changed"
:::::: 

BCC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
TO: Nilay Shroff <[email protected]>
CC: Keith Busch <[email protected]>
CC: Christoph Hellwig <[email protected]>

tree:   git://git.infradead.org/nvme.git nvme-7.3
head:   b53d495c7f0db46b6748b5ade48371a10dd5d3bc
commit: fccada336f6d29344e3853d44b96684807dd7d7d [45/48] nvme: enable context analysis support for nvme host driver
:::::: branch date: 11 hours ago
:::::: commit date: 15 hours ago
config: loongarch-defconfig (https://download.01.org/0day-ci/archive/20260729/[email protected]/config)
compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project 890b11e09e45e9d8b29f2f94f22052be3934e757)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260729/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/r/[email protected]/

All warnings (new ones prefixed by >>):

>> drivers/nvme/host/multipath.c:249:38: warning: reading variable 'current_path' requires holding __ctx_lock_RCU 'RCU' [-Wthread-safety-analysis]
     249 |                 if (ns == rcu_access_pointer(head->current_path[node])) {
         |                                                    ^
   1 warning generated.


vim +249 drivers/nvme/host/multipath.c

0d0b660f214dc49 Christoph Hellwig 2018-05-14  241  
0157ec8dad3c8fc Sagi Grimberg     2019-07-25  242  bool nvme_mpath_clear_current_path(struct nvme_ns *ns)
32acab3181c7053 Christoph Hellwig 2017-11-02  243  {
f333444708f82c4 Christoph Hellwig 2018-09-11  244  	struct nvme_ns_head *head = ns->head;
0157ec8dad3c8fc Sagi Grimberg     2019-07-25  245  	bool changed = false;
f333444708f82c4 Christoph Hellwig 2018-09-11  246  	int node;
f333444708f82c4 Christoph Hellwig 2018-09-11  247  
f333444708f82c4 Christoph Hellwig 2018-09-11  248  	for_each_node(node) {
0157ec8dad3c8fc Sagi Grimberg     2019-07-25 @249  		if (ns == rcu_access_pointer(head->current_path[node])) {
f333444708f82c4 Christoph Hellwig 2018-09-11  250  			rcu_assign_pointer(head->current_path[node], NULL);
0157ec8dad3c8fc Sagi Grimberg     2019-07-25  251  			changed = true;
0157ec8dad3c8fc Sagi Grimberg     2019-07-25  252  		}
f333444708f82c4 Christoph Hellwig 2018-09-11  253  	}
0157ec8dad3c8fc Sagi Grimberg     2019-07-25  254  	return changed;
0157ec8dad3c8fc Sagi Grimberg     2019-07-25  255  }
0157ec8dad3c8fc Sagi Grimberg     2019-07-25  256  

:::::: The code at line 249 was first introduced by commit
:::::: 0157ec8dad3c8fc9bc9790f76e0831ffdaf2e7f0 nvme: fix controller removal race with scan work

:::::: TO: Sagi Grimberg <[email protected]>
:::::: CC: Sagi Grimberg <[email protected]>

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki