From: Jan Kara <jack@suse.cz>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Jan Kara <jack@suse.cz>, Guenter Roeck <linux@roeck-us.net>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: Crashes in next-20160915 (BUG at fs/notify/notification.c:66!)
Date: Wed, 21 Sep 2016 11:15:11 +0200 [thread overview]
Message-ID: <20160921091511.GC3725@quack2.suse.cz> (raw)
In-Reply-To: <87k2e6sro3.fsf@concordia.ellerman.id.au>
On Tue 20-09-16 22:05:00, Michael Ellerman wrote:
> Andrew Morton <akpm@linux-foundation.org> writes:
> > On Tue, 20 Sep 2016 11:10:35 +1000 Michael Ellerman <mpe@ellerman.id.au> wrote:
> >> Jan Kara <jack@suse.cz> writes:
> >> >
> >> > Right, that was the problem. spin_is_locked() without CONFIG_SPINLOCK_DEBUG
> >> > returns always 0.
> >>
> >> Can we get this fixed soon please? It's breaking all my CI runs.
> >
> > It should be fixed in next -next.
>
> Great thanks.
>
> I did search LKML to see if Jan had sent a fix but I guess I missed it.
I didn't send the fix to LKML but only to linux-fsdevel...
> > diff -puN fs/notify/fanotify/fanotify_user.c~fsnotify-convert-notification_mutex-to-a-spinlock-fix fs/notify/fanotify/fanotify_user.c
> > --- a/fs/notify/fanotify/fanotify_user.c~fsnotify-convert-notification_mutex-to-a-spinlock-fix
> > +++ a/fs/notify/fanotify/fanotify_user.c
> > @@ -54,7 +54,8 @@ struct kmem_cache *fanotify_perm_event_c
> > static struct fsnotify_event *get_one_event(struct fsnotify_group *group,
> > size_t count)
> > {
> > - BUG_ON(!spin_is_locked(&group->notification_lock));
> > + BUG_ON(IS_ENABLED(CONFIG_SMP) &&
> > + !spin_is_locked(&group->notification_lock));
>
> I thought lockdep_assert_held() was preferred for checks like this that
> are purely sanity checking, ie. not part of the algorithm.
As pointed out by other guy, assert_spin_locked() is probably the right way
to do it (it's a wrapper that does essentially what I did here). Somehow I
missed that when looking for the right fix.
Honza
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
prev parent reply other threads:[~2016-09-21 9:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-16 2:20 Guenter Roeck
2016-09-16 6:45 ` Jan Kara
2016-09-16 11:10 ` Guenter Roeck
2016-09-16 12:49 ` Jan Kara
2016-09-20 1:10 ` Michael Ellerman
2016-09-20 1:13 ` Andrew Morton
2016-09-20 12:05 ` Michael Ellerman
2016-09-21 9:15 ` Jan Kara [this message]
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=20160921091511.GC3725@quack2.suse.cz \
--to=jack@suse.cz \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=mpe@ellerman.id.au \
/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®