fs/namei.c:6321:9: sparse: sparse: cast from restricted gfp_t
From: kernel test robot
Date: Fri Jul 10 2026 - 21:53:48 EST
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: a635d6748234582ea287c5ffeae28b9b23f91c7e
commit: feb662d9168b63e1d4c02671ec96005410c6f3ce slab: support for compiler-assisted type-based slab cache partitioning
date: 8 weeks ago
config: mips-randconfig-r111-20260711 (https://download.01.org/0day-ci/archive/20260711/202607110912.nZTqfCrH-lkp@xxxxxxxxx/config)
compiler: clang version 23.0.0git (https://github.com/llvm/llvm-project b3e6e6dabdc02153552a64fc74ff5c7532447eed)
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260711/202607110912.nZTqfCrH-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/202607110912.nZTqfCrH-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:6321:9: sparse: sparse: cast from restricted gfp_t
vim +6321 fs/namei.c
d60874cd58fcb21 Miklos Szeredi 2016-10-04 6299
^1da177e4c3f415 Linus Torvalds 2005-04-16 6300 /* get the link contents into pagecache */
b4c173dfbb6c785 Miklos Szeredi 2025-02-20 6301 static char *__page_get_link(struct dentry *dentry, struct inode *inode,
fceef393a538134 Al Viro 2015-12-29 6302 struct delayed_call *callback)
^1da177e4c3f415 Linus Torvalds 2005-04-16 6303 {
5f152cc012f42e1 Matthew Wilcox (Oracle 2025-05-14 6304) struct folio *folio;
6b2553918d8b4e6 Al Viro 2015-11-17 6305 struct address_space *mapping = inode->i_mapping;
6b2553918d8b4e6 Al Viro 2015-11-17 6306
d3883d4f9344934 Al Viro 2015-11-17 6307 if (!dentry) {
5f152cc012f42e1 Matthew Wilcox (Oracle 2025-05-14 6308) folio = filemap_get_folio(mapping, 0);
5f152cc012f42e1 Matthew Wilcox (Oracle 2025-05-14 6309) if (IS_ERR(folio))
6b2553918d8b4e6 Al Viro 2015-11-17 6310 return ERR_PTR(-ECHILD);
5f152cc012f42e1 Matthew Wilcox (Oracle 2025-05-14 6311) if (!folio_test_uptodate(folio)) {
5f152cc012f42e1 Matthew Wilcox (Oracle 2025-05-14 6312) folio_put(folio);
d3883d4f9344934 Al Viro 2015-11-17 6313 return ERR_PTR(-ECHILD);
d3883d4f9344934 Al Viro 2015-11-17 6314 }
d3883d4f9344934 Al Viro 2015-11-17 6315 } else {
5f152cc012f42e1 Matthew Wilcox (Oracle 2025-05-14 6316) folio = read_mapping_folio(mapping, 0, NULL);
5f152cc012f42e1 Matthew Wilcox (Oracle 2025-05-14 6317) if (IS_ERR(folio))
5f152cc012f42e1 Matthew Wilcox (Oracle 2025-05-14 6318) return ERR_CAST(folio);
d3883d4f9344934 Al Viro 2015-11-17 6319 }
4ec373b74e96f92 Matthew Wilcox (Oracle 2025-05-14 6320) set_delayed_call(callback, page_put_link, folio);
21fc61c73c3903c Al Viro 2015-11-17 @6321 BUG_ON(mapping_gfp_mask(mapping) & __GFP_HIGHMEM);
5f152cc012f42e1 Matthew Wilcox (Oracle 2025-05-14 6322) return folio_address(folio);
b4c173dfbb6c785 Miklos Szeredi 2025-02-20 6323 }
b4c173dfbb6c785 Miklos Szeredi 2025-02-20 6324
:::::: The code at line 6321 was first introduced by commit
:::::: 21fc61c73c3903c4c312d0802da01ec2b323d174 don't put symlink bodies in pagecache into highmem
:::::: TO: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
:::::: CC: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki