fs/namei.c:142:16: sparse: sparse: cast truncates bits from constant value (123456789abcdef becomes 89abcdef)

From: kernel test robot

Date: Fri Jul 17 2026 - 11:27:22 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: fce2dfa773ced15f27dd27cd0b482a7473cdcf2a
commit: feb662d9168b63e1d4c02671ec96005410c6f3ce slab: support for compiler-assisted type-based slab cache partitioning
date: 9 weeks ago
config: i386-randconfig-r123-20260717 (https://download.01.org/0day-ci/archive/20260717/202607172359.RRXiDyop-lkp@xxxxxxxxx/config)
compiler: clang version 22.1.3 (https://github.com/llvm/llvm-project e9846648fd6183ee6d8cbdb4502213fcf902a211)
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260717/202607172359.RRXiDyop-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
| Fixes: feb662d9168b ("slab: support for compiler-assisted type-based slab cache partitioning")
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202607172359.RRXiDyop-lkp@xxxxxxxxx/

sparse warnings: (new ones prefixed by >>)
fs/namei.c:159:33: sparse: sparse: undefined identifier '__builtin_infer_alloc_token'
fs/namei.c:159:33: sparse: sparse: undefined identifier '__builtin_infer_alloc_token'
fs/namei.c:159:33: sparse: sparse: undefined identifier '__builtin_infer_alloc_token'
fs/namei.c:793:12: sparse: sparse: undefined identifier '__builtin_infer_alloc_token'
fs/namei.c:793:12: sparse: sparse: undefined identifier '__builtin_infer_alloc_token'
fs/namei.c:793:12: sparse: sparse: undefined identifier '__builtin_infer_alloc_token'
>> fs/namei.c:142:16: sparse: sparse: cast truncates bits from constant value (123456789abcdef becomes 89abcdef)
>> fs/namei.c:142:16: sparse: sparse: cast truncates bits from constant value (123456789abcdef becomes 89abcdef)
fs/namei.c:147:25: sparse: sparse: cast truncates bits from constant value (123456789abcdef becomes 89abcdef)

vim +142 fs/namei.c

c3a3577cdb351e Al Viro 2025-11-19 139
c3a3577cdb351e Al Viro 2025-11-19 140 static inline struct filename *alloc_filename(void)
c3a3577cdb351e Al Viro 2025-11-19 141 {
7ca83f8ebe8670 Mateusz Guzik 2025-12-01 @142 return kmem_cache_alloc(names_cache, GFP_KERNEL);
c3a3577cdb351e Al Viro 2025-11-19 143 }
91a27b2a756784 Jeff Layton 2012-10-10 144

:::::: The code at line 142 was first introduced by commit
:::::: 7ca83f8ebe86706c4164ac21871f4a5adb86a430 fs: hide names_cache behind runtime const machinery

:::::: TO: Mateusz Guzik <mjguzik@xxxxxxxxx>
:::::: CC: Al Viro <viro@xxxxxxxxxxxxxxxxxx>

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