Skip to contentSkip to conversation

fs/nfs/getroot.c:90:17: sparse: sparse: incompatible types in conditional expression (different base types):

PATCH kernel test robot 1 participant 1 message Mar 10

lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/cel/linux nfsd-testing
head:   ab3a77c508e7f4484df05699b2209ac34f4721c4
commit: 5d44b75a53924f33acd6ad924c7b6a7999b36637 [24/76] sunrpc: Fix compilation error (`make W=1`) when dprintk() is no-op
config: x86_64-randconfig-121-20260310 (https://download.01.org/0day-ci/archive/20260311/[email protected]/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260311/[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/oe-kbuild-all/[email protected]/

sparse warnings: (new ones prefixed by >>)

>> fs/nfs/getroot.c:90:17: sparse: sparse: incompatible types in conditional expression (different base types):

fs/nfs/getroot.c:90:17: sparse: void
fs/nfs/getroot.c:90:17: sparse: int
fs/nfs/getroot.c:98:17: sparse: sparse: incompatible types in conditional expression (different base types):
fs/nfs/getroot.c:98:17: sparse: void
fs/nfs/getroot.c:98:17: sparse: int
fs/nfs/getroot.c:114:17: sparse: sparse: incompatible types in conditional expression (different base types):
fs/nfs/getroot.c:114:17: sparse: void
fs/nfs/getroot.c:114:17: sparse: int
--

>> fs/nfs/namespace.c:304:17: sparse: sparse: incompatible types in conditional expression (different base types):
   fs/nfs/namespace.c:304:17: sparse:    void
   fs/nfs/namespace.c:304:17: sparse:    int
--
>> fs/nfs/nfs4super.c:232:17: sparse: sparse: incompatible types in conditional expression (different base types):

fs/nfs/nfs4super.c:232:17: sparse: void
fs/nfs/nfs4super.c:232:17: sparse: int
fs/nfs/nfs4super.c:255:17: sparse: sparse: incompatible types in conditional expression (different base types):
fs/nfs/nfs4super.c:255:17: sparse: void
fs/nfs/nfs4super.c:255:17: sparse: int

vim +90 fs/nfs/getroot.c

b09b9417d074e01 Trond Myklebust 2007-10-25  63  
54ceac451598603 David Howells   2006-08-22  64  /*
6d26c5e4d83cd39 Li Lingfeng     2024-08-24  65   * get a root dentry from the root filehandle
54ceac451598603 David Howells   2006-08-22  66   */
62a55d088cd87d4 Scott Mayhew    2019-12-10  67  int nfs_get_root(struct super_block *s, struct fs_context *fc)
54ceac451598603 David Howells   2006-08-22  68  {
62a55d088cd87d4 Scott Mayhew    2019-12-10  69  	struct nfs_fs_context *ctx = nfs_fc2context(fc);
eae00c5d6e48ccb Scott Mayhew    2021-06-22  70  	struct nfs_server *server = NFS_SB(s), *clone_server;
54ceac451598603 David Howells   2006-08-22  71  	struct nfs_fsinfo fsinfo;
62a55d088cd87d4 Scott Mayhew    2019-12-10  72  	struct dentry *root;
54ceac451598603 David Howells   2006-08-22  73  	struct inode *inode;
62a55d088cd87d4 Scott Mayhew    2019-12-10  74  	char *name;
62a55d088cd87d4 Scott Mayhew    2019-12-10  75  	int error = -ENOMEM;
779df6a5480f130 Scott Mayhew    2020-03-03  76  	unsigned long kflags = 0, kflags_out = 0;
54ceac451598603 David Howells   2006-08-22  77  
62a55d088cd87d4 Scott Mayhew    2019-12-10  78  	name = kstrdup(fc->source, GFP_KERNEL);
b1942c5f8cf3bea Al Viro         2011-03-16  79  	if (!name)
62a55d088cd87d4 Scott Mayhew    2019-12-10  80  		goto out;
b1942c5f8cf3bea Al Viro         2011-03-16  81  
54ceac451598603 David Howells   2006-08-22  82  	/* get the actual root for this mount */
d755ad8dc752d44 Anna Schumaker  2021-10-22  83  	fsinfo.fattr = nfs_alloc_fattr_with_label(server);
62a55d088cd87d4 Scott Mayhew    2019-12-10  84  	if (fsinfo.fattr == NULL)
62a55d088cd87d4 Scott Mayhew    2019-12-10  85  		goto out_name;
54ceac451598603 David Howells   2006-08-22  86  
62a55d088cd87d4 Scott Mayhew    2019-12-10  87  	error = server->nfs_client->rpc_ops->getroot(server, ctx->mntfh, &fsinfo);
54ceac451598603 David Howells   2006-08-22  88  	if (error < 0) {
54ceac451598603 David Howells   2006-08-22  89  		dprintk("nfs_get_root: getattr error = %d\n", -error);

ce8866f0913ff15 Scott Mayhew 2019-12-10 @90 nfs_errorf(fc, "NFS: Couldn't getattr on root");

:::::: The code at line 90 was first introduced by commit
:::::: ce8866f0913ff157edc098f06bad07763ad317e7 NFS: Attach supplementary error information to fs_context.

:::::: TO: Scott Mayhew <[email protected]> :::::: CC: Anna Schumaker <[email protected]>

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