mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Shakeel Butt <shakeel.butt@linux.dev>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
	Christian Brauner <brauner@kernel.org>
Subject: fs/kernfs/dir.c:751:31: sparse: sparse: cast to non-scalar
Date: Mon, 26 Oct 2026 17:04:20 +0100	[thread overview]
Message-ID: <202610261608.vItiXCGW-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   6b4b543fa18757297ac756a6fe6e64f506b7844a
commit: 81bdc85b4c086502f4446a58eb5d25f29bb5e9f7 kernfs: fix up the unlocked attribute reads on the creation paths
date:   7 weeks ago
config: alpha-randconfig-r2309-20261026 (https://download.01.org/0day-ci/archive/20261026/202610261608.vItiXCGW-lkp@intel.com/config)
compiler: alpha-linux-gcc (GCC) 8.5.0
sparse: v0.6.5-rc1-1-gc4640450
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261026/202610261608.vItiXCGW-lkp@intel.com/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: 81bdc85b4c08 ("kernfs: fix up the unlocked attribute reads on the creation paths")
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202610261608.vItiXCGW-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> fs/kernfs/dir.c:751:31: sparse: sparse: cast to non-scalar
>> fs/kernfs/dir.c:751:31: sparse: sparse: cast from non-scalar

vim +751 fs/kernfs/dir.c

   731	
   732	struct kernfs_node *kernfs_new_node(struct kernfs_node *parent,
   733					    const char *name, umode_t mode,
   734					    kuid_t uid, kgid_t gid,
   735					    unsigned flags)
   736	{
   737		struct kernfs_node *kn;
   738	
   739		/*
   740		 * The mode and the gid below are read unlocked on purpose: they feed
   741		 * a node that does not exist yet, so nothing orders a racing chmod or
   742		 * chown against this creation.
   743		 */
   744		if (READ_ONCE(parent->mode) & S_ISGID) {
   745			/* this code block imitates inode_init_owner() for
   746			 * kernfs
   747			 */
   748			struct kernfs_iattrs *attrs = READ_ONCE(parent->iattr);
   749	
   750			if (attrs)
 > 751				gid = READ_ONCE(attrs->ia_gid);
   752	
   753			if (flags & KERNFS_DIR)
   754				mode |= S_ISGID;
   755		}
   756	
   757		kn = __kernfs_new_node(kernfs_root(parent), parent,
   758				       name, mode, uid, gid, flags);
   759		return kn;
   760	}
   761	

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

                 reply	other threads:[~2026-10-26 16:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202610261608.vItiXCGW-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=brauner@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=shakeel.butt@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®