linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Jules Irenge <jbi.octave@gmail.com>
Cc: Jan Kara <jack@suse.cz>,
	linux-kernel@vger.kernel.org, boqun.feng@gmail.com,
	Amir Goldstein <amir73il@gmail.com>,
	"open list:FSNOTIFY: FILESYSTEM NOTIFICATION INFRASTRUCTURE" 
	<linux-fsdevel@vger.kernel.org>
Subject: Re: [PATCH 2/7] fsnotify: Add missing annotation for fsnotify_finish_user_wait()
Date: Fri, 3 Apr 2020 18:52:25 +0200	[thread overview]
Message-ID: <20200403165225.GC29920@quack2.suse.cz> (raw)
In-Reply-To: <alpine.LFD.2.21.2004031710120.10601@earth.lan>

On Fri 03-04-20 17:15:44, Jules Irenge wrote:
> 
> 
> On Wed, 1 Apr 2020, Jan Kara wrote:
> 
> > On Tue 31-03-20 21:46:38, Jules Irenge wrote:
> > > Sparse reports a warning at fsnotify_finish_user_wait()
> > > 
> > > warning: context imbalance in fsnotify_finish_user_wait()
> > > 	- wrong count at exit
> > > 
> > > The root cause is the missing annotation at fsnotify_finish_user_wait()
> > > Add the missing __acquires(&fsnotify_mark_srcu) annotation.
> > > 
> > > Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
> > 
> > OK, but then fsnotify_prepare_user_wait() needs __releases annotation as
> > well if we're going to be serious about sparse warnings in this code?
> > 
> > 								Honza
> > 
> > > ---
> > >  fs/notify/mark.c | 1 +
> > >  1 file changed, 1 insertion(+)
> > > 
> > > diff --git a/fs/notify/mark.c b/fs/notify/mark.c
> > > index 1d96216dffd1..44fea637bb02 100644
> > > --- a/fs/notify/mark.c
> > > +++ b/fs/notify/mark.c
> > > @@ -350,6 +350,7 @@ bool fsnotify_prepare_user_wait(struct fsnotify_iter_info *iter_info)
> > >  }
> > > 
> > >  void fsnotify_finish_user_wait(struct fsnotify_iter_info *iter_info)
> > > +	__acquires(&fsnotify_mark_srcu)
> > >  {
> > >  	int type;
> > > 
> > > --
> > > 2.24.1
> > > 
> > -- 
> > Jan Kara <jack@suse.com>
> > SUSE Labs, CR
> > 
> 
> Thanks for the reply. I think adding an annotation at
> fsnotify_prepare_user_wait() will not theoretically remove the warning.
> That's the only reason why I skipped it .

Well, I think the goal isn't really to remove warnings but to make
annotations correct... So even if sparse was not clever enough to spot that
missing annotation, you should add it if you've decided to fix sparse
annotations for fsnotify code.

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

  reply	other threads:[~2020-04-03 16:52 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <0/7>
2020-03-31 20:46 ` [PATCH 0/7] Lock warnings cleanup Jules Irenge
2020-03-31 20:46   ` [PATCH 1/7] fs: Add missing annotation for iput_final() Jules Irenge
2020-03-31 20:46   ` [PATCH 2/7] fsnotify: Add missing annotation for fsnotify_finish_user_wait() Jules Irenge
2020-04-01  9:24     ` Jan Kara
2020-04-03 16:15       ` Jules Irenge
2020-04-03 16:52         ` Jan Kara [this message]
2020-03-31 20:46   ` [PATCH 3/7] dax: Add missing annotation for wait_entry_unlocked() Jules Irenge
2020-04-01 10:01     ` Jan Kara
2020-04-01 16:04       ` Jules Irenge
2020-03-31 20:46   ` [PATCH 4/7] sysctl: Add missing annotation for start_unregistering() Jules Irenge
2020-04-02 16:06     ` Luis Chamberlain
2020-03-31 20:46   ` [PATCH 5/7] btrfs: Add missing annotation for btrfs_lock_cluster() Jules Irenge
2020-04-01 15:57     ` David Sterba
2020-03-31 20:46   ` [PATCH 6/7] btrfs: Add missing annotation for btrfs_tree_lock() Jules Irenge
2020-03-31 20:46   ` [PATCH 7/7] tty: serial_core: Add missing annotation for _unlock_and_check_sysrq() Jules Irenge
2020-04-16 13:58     ` Greg Kroah-Hartman

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=20200403165225.GC29920@quack2.suse.cz \
    --to=jack@suse.cz \
    --cc=amir73il@gmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=jbi.octave@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).