All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Mark Rutland <mark.rutland@arm.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
	Ingo Molnar <mingo@kernel.org>
Subject: fs/notify/mark.c:462:13: sparse: sparse: incorrect type in initializer (different address spaces)
Date: Fri, 15 Dec 2023 05:26:48 +0800	[thread overview]
Message-ID: <202312150531.zCYPyiP3-lkp@intel.com> (raw)

Hi Mark,

FYI, the error/warning was bisected to this commit, please ignore it if it's irrelevant.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   5bd7ef53ffe5ca580e93e74eb8c81ed191ddc4bd
commit: df79ed2c064363cdc7d2d896923c1885d4e30520 locking/atomics: Simplify cmpxchg() instrumentation
date:   5 years ago
config: x86_64-randconfig-x003-20230627 (https://download.01.org/0day-ci/archive/20231215/202312150531.zCYPyiP3-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231215/202312150531.zCYPyiP3-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
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202312150531.zCYPyiP3-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> fs/notify/mark.c:462:13: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected struct fsnotify_mark_connector [noderef] __rcu *__new @@     got struct fsnotify_mark_connector *[assigned] conn @@
   fs/notify/mark.c:462:13: sparse:     expected struct fsnotify_mark_connector [noderef] __rcu *__new
   fs/notify/mark.c:462:13: sparse:     got struct fsnotify_mark_connector *[assigned] conn
   fs/notify/mark.c:224:9: sparse: sparse: context imbalance in 'fsnotify_put_mark' - unexpected unlock
   fs/notify/mark.c:310:25: sparse: sparse: context imbalance in 'fsnotify_prepare_user_wait' - unexpected unlock
   fs/notify/mark.c:325:9: sparse: sparse: context imbalance in 'fsnotify_finish_user_wait' - wrong count at exit
   fs/notify/mark.c:478:39: sparse: sparse: context imbalance in 'fsnotify_grab_connector' - different lock contexts for basic block
   fs/notify/mark.c:562:20: sparse: sparse: context imbalance in 'fsnotify_add_mark_list' - unexpected unlock
   fs/notify/mark.c:646:25: sparse: sparse: context imbalance in 'fsnotify_find_mark' - unexpected unlock
   fs/notify/mark.c:718:17: sparse: sparse: context imbalance in 'fsnotify_destroy_marks' - unexpected unlock
   fs/notify/mark.o: warning: objtool: fsnotify_grab_connector()+0x17d: sibling call from callable instruction with modified stack frame
   fs/notify/mark.o: warning: objtool: fsnotify_put_mark_wake()+0x9e: sibling call from callable instruction with modified stack frame
   fs/notify/mark.o: warning: objtool: fsnotify_clear_marks_by_group()+0x1b2: sibling call from callable instruction with modified stack frame

vim +462 fs/notify/mark.c

8edc6e1688fc8f Jan Kara       2014-11-13  438  
9dd813c15b2c10 Jan Kara       2017-03-14  439  static int fsnotify_attach_connector_to_object(
08991e83b72866 Jan Kara       2017-02-01  440  				struct fsnotify_mark_connector __rcu **connp,
86ffe245c430f0 Jan Kara       2017-03-14  441  				struct inode *inode,
86ffe245c430f0 Jan Kara       2017-03-14  442  				struct vfsmount *mnt)
9dd813c15b2c10 Jan Kara       2017-03-14  443  {
9dd813c15b2c10 Jan Kara       2017-03-14  444  	struct fsnotify_mark_connector *conn;
9dd813c15b2c10 Jan Kara       2017-03-14  445  
755b5bc681eb46 Jan Kara       2017-03-14  446  	conn = kmem_cache_alloc(fsnotify_mark_connector_cachep, GFP_KERNEL);
9dd813c15b2c10 Jan Kara       2017-03-14  447  	if (!conn)
9dd813c15b2c10 Jan Kara       2017-03-14  448  		return -ENOMEM;
04662cab59fc3e Jan Kara       2017-02-01  449  	spin_lock_init(&conn->lock);
9dd813c15b2c10 Jan Kara       2017-03-14  450  	INIT_HLIST_HEAD(&conn->list);
86ffe245c430f0 Jan Kara       2017-03-14  451  	if (inode) {
d6f7b98bc8147a Amir Goldstein 2018-04-20  452  		conn->type = FSNOTIFY_OBJ_TYPE_INODE;
08991e83b72866 Jan Kara       2017-02-01  453  		conn->inode = igrab(inode);
86ffe245c430f0 Jan Kara       2017-03-14  454  	} else {
d6f7b98bc8147a Amir Goldstein 2018-04-20  455  		conn->type = FSNOTIFY_OBJ_TYPE_VFSMOUNT;
86ffe245c430f0 Jan Kara       2017-03-14  456  		conn->mnt = mnt;
86ffe245c430f0 Jan Kara       2017-03-14  457  	}
9dd813c15b2c10 Jan Kara       2017-03-14  458  	/*
04662cab59fc3e Jan Kara       2017-02-01  459  	 * cmpxchg() provides the barrier so that readers of *connp can see
04662cab59fc3e Jan Kara       2017-02-01  460  	 * only initialized structure
9dd813c15b2c10 Jan Kara       2017-03-14  461  	 */
04662cab59fc3e Jan Kara       2017-02-01 @462  	if (cmpxchg(connp, NULL, conn)) {
04662cab59fc3e Jan Kara       2017-02-01  463  		/* Someone else created list structure for us */
08991e83b72866 Jan Kara       2017-02-01  464  		if (inode)
08991e83b72866 Jan Kara       2017-02-01  465  			iput(inode);
755b5bc681eb46 Jan Kara       2017-03-14  466  		kmem_cache_free(fsnotify_mark_connector_cachep, conn);
04662cab59fc3e Jan Kara       2017-02-01  467  	}
9dd813c15b2c10 Jan Kara       2017-03-14  468  
9dd813c15b2c10 Jan Kara       2017-03-14  469  	return 0;
9dd813c15b2c10 Jan Kara       2017-03-14  470  }
9dd813c15b2c10 Jan Kara       2017-03-14  471  

:::::: The code at line 462 was first introduced by commit
:::::: 04662cab59fc3e8421fd7a0539d304d51d2750a4 fsnotify: Lock object list with connector lock

:::::: TO: Jan Kara <jack@suse.cz>
:::::: CC: Jan Kara <jack@suse.cz>

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

                 reply	other threads:[~2023-12-14 21:27 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=202312150531.zCYPyiP3-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@kernel.org \
    --cc=oe-kbuild-all@lists.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.