From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932291AbcIUJPU (ORCPT ); Wed, 21 Sep 2016 05:15:20 -0400 Received: from mx2.suse.de ([195.135.220.15]:38996 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755542AbcIUJPQ (ORCPT ); Wed, 21 Sep 2016 05:15:16 -0400 Date: Wed, 21 Sep 2016 11:15:11 +0200 From: Jan Kara To: Michael Ellerman Cc: Andrew Morton , Jan Kara , Guenter Roeck , "linux-kernel@vger.kernel.org" Subject: Re: Crashes in next-20160915 (BUG at fs/notify/notification.c:66!) Message-ID: <20160921091511.GC3725@quack2.suse.cz> References: <20160916064521.GF24269@quack2.suse.cz> <6ae57328-ab25-8798-51f9-9a30d9c2af70@roeck-us.net> <20160916124948.GG24269@quack2.suse.cz> <87vaxrs7ec.fsf@concordia.ellerman.id.au> <20160919181342.ef41286b6cbd45a27a5968a7@linux-foundation.org> <87k2e6sro3.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87k2e6sro3.fsf@concordia.ellerman.id.au> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 20-09-16 22:05:00, Michael Ellerman wrote: > Andrew Morton writes: > > On Tue, 20 Sep 2016 11:10:35 +1000 Michael Ellerman wrote: > >> Jan Kara 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 SUSE Labs, CR