Return-Path: Received: from mx2.suse.de ([195.135.220.15]:33122 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727387AbfAIJMf (ORCPT ); Wed, 9 Jan 2019 04:12:35 -0500 Date: Wed, 9 Jan 2019 10:12:33 +0100 From: Jan Kara To: Amir Goldstein Cc: Jan Kara , linux-fsdevel , Vivek Trivedi , Orion Poplawski , Konstantin Khlebnikov Subject: Re: [PATCH 2/4] fanotify: Move locking inside get_one_event() Message-ID: <20190109091233.GB15397@quack2.suse.cz> References: <20190108164611.11440-1-jack@suse.cz> <20190108164611.11440-3-jack@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed 09-01-19 09:09:20, Amir Goldstein wrote: > On Tue, Jan 8, 2019 at 6:46 PM Jan Kara wrote: > > > > get_one_event() has a single caller and that just locks > > notification_lock around the call. Move locking inside get_one_event() > > as that will make using ->response field for permission event state > > easier. > > > > Signed-off-by: Jan Kara > > --- > > fs/notify/fanotify/fanotify_user.c | 26 +++++++++++--------------- > > 1 file changed, 11 insertions(+), 15 deletions(-) > > > > diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c > > index 908ebc421d15..2b2c8b8a17bd 100644 > > --- a/fs/notify/fanotify/fanotify_user.c > > +++ b/fs/notify/fanotify/fanotify_user.c > > @@ -51,25 +51,24 @@ struct kmem_cache *fanotify_perm_event_cachep __read_mostly; > > * Get an fsnotify notification event if one exists and is small > > * enough to fit in "count". Return an error pointer if the count > > * is not large enough. > > - * > > - * Called with the group->notification_lock held. > > */ > > static struct fsnotify_event *get_one_event(struct fsnotify_group *group, > > size_t count) > > { > > - assert_spin_locked(&group->notification_lock); > > - > > - pr_debug("%s: group=%p count=%zd\n", __func__, group, count); > > I see you are slowly cleaning up pr_debug calls. Any particular reason? > Out of all the spam pr_debug calls in the code, this one looks rather useful. I didn't find it useful but if you think I it, I'll leave it in. Honza -- Jan Kara SUSE Labs, CR