include/linux/list.h:74:19: warning: storing the address of local variable 'realm_queue' in '*&realm_24(D)->rebuild_item.prev'
From: kernel test robot
Date: Sat Mar 14 2026 - 16:08:29 EST
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 80234b5ab240f52fa45d201e899e207b9265ef91
commit: 74a31df4f1f16807a93e414a322baf6eceddb60d ceph: eliminate the recursion when rebuilding the snap context
date: 4 years ago
config: mips-allyesconfig (https://download.01.org/0day-ci/archive/20260315/202603150451.HnobCkPK-lkp@xxxxxxxxx/config)
compiler: mips-linux-gcc (GCC) 15.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260315/202603150451.HnobCkPK-lkp@xxxxxxxxx/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 <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202603150451.HnobCkPK-lkp@xxxxxxxxx/
All warnings (new ones prefixed by >>):
In file included from include/linux/preempt.h:11,
from include/linux/spinlock.h:55,
from include/linux/mmzone.h:8,
from include/linux/gfp.h:6,
from include/linux/slab.h:15,
from fs/ceph/snap.c:5:
In function '__list_add',
inlined from 'list_add_tail' at include/linux/list.h:102:2,
inlined from 'rebuild_snap_realms' at fs/ceph/snap.c:429:2:
>> include/linux/list.h:74:19: warning: storing the address of local variable 'realm_queue' in '*&realm_24(D)->rebuild_item.prev' [-Wdangling-pointer=]
74 | new->prev = prev;
| ~~~~~~~~~~^~~~~~
fs/ceph/snap.c: In function 'rebuild_snap_realms':
fs/ceph/snap.c:425:19: note: 'realm_queue' declared here
425 | LIST_HEAD(realm_queue);
| ^~~~~~~~~~~
include/linux/list.h:26:26: note: in definition of macro 'LIST_HEAD'
26 | struct list_head name = LIST_HEAD_INIT(name)
| ^~~~
fs/ceph/snap.c:422:57: note: 'realm' declared here
422 | static void rebuild_snap_realms(struct ceph_snap_realm *realm,
| ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
vim +74 include/linux/list.h
d7c816733d501b Kees Cook 2016-08-17 58
^1da177e4c3f41 Linus Torvalds 2005-04-16 59 /*
^1da177e4c3f41 Linus Torvalds 2005-04-16 60 * Insert a new entry between two known consecutive entries.
^1da177e4c3f41 Linus Torvalds 2005-04-16 61 *
^1da177e4c3f41 Linus Torvalds 2005-04-16 62 * This is only for internal list manipulation where we know
^1da177e4c3f41 Linus Torvalds 2005-04-16 63 * the prev/next entries already!
^1da177e4c3f41 Linus Torvalds 2005-04-16 64 */
^1da177e4c3f41 Linus Torvalds 2005-04-16 65 static inline void __list_add(struct list_head *new,
^1da177e4c3f41 Linus Torvalds 2005-04-16 66 struct list_head *prev,
^1da177e4c3f41 Linus Torvalds 2005-04-16 67 struct list_head *next)
^1da177e4c3f41 Linus Torvalds 2005-04-16 68 {
d7c816733d501b Kees Cook 2016-08-17 69 if (!__list_add_valid(new, prev, next))
d7c816733d501b Kees Cook 2016-08-17 70 return;
d7c816733d501b Kees Cook 2016-08-17 71
^1da177e4c3f41 Linus Torvalds 2005-04-16 72 next->prev = new;
^1da177e4c3f41 Linus Torvalds 2005-04-16 73 new->next = next;
^1da177e4c3f41 Linus Torvalds 2005-04-16 @74 new->prev = prev;
1c97be677f72b3 Paul E. McKenney 2015-09-20 75 WRITE_ONCE(prev->next, new);
^1da177e4c3f41 Linus Torvalds 2005-04-16 76 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 77
:::::: The code at line 74 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2
:::::: TO: Linus Torvalds <torvalds@xxxxxxxxxxxxxxx>
:::::: CC: Linus Torvalds <torvalds@xxxxxxxxxxxxxxx>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki