From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de ([195.135.220.15]:60656 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727091AbeJDNtI (ORCPT ); Thu, 4 Oct 2018 09:49:08 -0400 Date: Thu, 4 Oct 2018 08:57:20 +0200 From: Jan Kara To: Paul Moore Cc: jack@suse.cz, viro@zeniv.linux.org.uk, linux-audit@redhat.com, linux-fsdevel@vger.kernel.org, rgb@redhat.com, amir73il@gmail.com Subject: Re: [PATCH 09/11] audit: Allocate fsnotify mark independently of chunk Message-ID: <20181004065720.GA29482@quack2.suse.cz> References: <20180904160632.21210-1-jack@suse.cz> <20180904160632.21210-10-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 03-10-18 18:08:14, Paul Moore wrote: > On Tue, Sep 4, 2018 at 12:06 PM Jan Kara wrote: > > Allocate fsnotify mark independently instead of embedding it inside > > chunk. This will allow us to just replace chunk attached to mark when > > growing / shrinking chunk instead of replacing mark attached to inode > > which is a more complex operation. > > > > Signed-off-by: Jan Kara > > --- > > kernel/audit_tree.c | 64 +++++++++++++++++++++++++++++++++++++++++------------ > > 1 file changed, 50 insertions(+), 14 deletions(-) > > > > diff --git a/kernel/audit_tree.c b/kernel/audit_tree.c > > index 0cd08b3581f1..481fdc190c2f 100644 > > --- a/kernel/audit_tree.c > > +++ b/kernel/audit_tree.c > > @@ -142,10 +148,33 @@ static void audit_mark_put_chunk(struct audit_chunk *chunk) > > call_rcu(&chunk->head, __put_chunk); > > } > > > > +static inline struct audit_tree_mark *audit_mark(struct fsnotify_mark *entry) > > +{ > > + return container_of(entry, struct audit_tree_mark, mark); > > +} > > + > > +static struct audit_chunk *mark_chunk(struct fsnotify_mark *mark) > > +{ > > + return audit_mark(mark)->chunk; > > +} > > + > > ... > > > @@ -426,7 +460,7 @@ static int tag_chunk(struct inode *inode, struct audit_tree *tree) > > if (!old_entry) > > return create_chunk(inode, tree); > > > > - old = container_of(old_entry, struct audit_chunk, mark); > > + old = mark_chunk(old_entry)->chunk; > > I'm pretty sure you mean the following instead? > > old = mark_chunk(old_entry); Right, it gets fixed up in a later patch but it would be good to fix it here (e.g. not to break bisection). Honza -- Jan Kara SUSE Labs, CR From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kara Subject: Re: [PATCH 09/11] audit: Allocate fsnotify mark independently of chunk Date: Thu, 4 Oct 2018 08:57:20 +0200 Message-ID: <20181004065720.GA29482@quack2.suse.cz> References: <20180904160632.21210-1-jack@suse.cz> <20180904160632.21210-10-jack@suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-audit-bounces@redhat.com Errors-To: linux-audit-bounces@redhat.com To: Paul Moore Cc: jack@suse.cz, rgb@redhat.com, amir73il@gmail.com, linux-audit@redhat.com, viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org List-Id: linux-audit@redhat.com On Wed 03-10-18 18:08:14, Paul Moore wrote: > On Tue, Sep 4, 2018 at 12:06 PM Jan Kara wrote: > > Allocate fsnotify mark independently instead of embedding it inside > > chunk. This will allow us to just replace chunk attached to mark when > > growing / shrinking chunk instead of replacing mark attached to inode > > which is a more complex operation. > > > > Signed-off-by: Jan Kara > > --- > > kernel/audit_tree.c | 64 +++++++++++++++++++++++++++++++++++++++++------------ > > 1 file changed, 50 insertions(+), 14 deletions(-) > > > > diff --git a/kernel/audit_tree.c b/kernel/audit_tree.c > > index 0cd08b3581f1..481fdc190c2f 100644 > > --- a/kernel/audit_tree.c > > +++ b/kernel/audit_tree.c > > @@ -142,10 +148,33 @@ static void audit_mark_put_chunk(struct audit_chunk *chunk) > > call_rcu(&chunk->head, __put_chunk); > > } > > > > +static inline struct audit_tree_mark *audit_mark(struct fsnotify_mark *entry) > > +{ > > + return container_of(entry, struct audit_tree_mark, mark); > > +} > > + > > +static struct audit_chunk *mark_chunk(struct fsnotify_mark *mark) > > +{ > > + return audit_mark(mark)->chunk; > > +} > > + > > ... > > > @@ -426,7 +460,7 @@ static int tag_chunk(struct inode *inode, struct audit_tree *tree) > > if (!old_entry) > > return create_chunk(inode, tree); > > > > - old = container_of(old_entry, struct audit_chunk, mark); > > + old = mark_chunk(old_entry)->chunk; > > I'm pretty sure you mean the following instead? > > old = mark_chunk(old_entry); Right, it gets fixed up in a later patch but it would be good to fix it here (e.g. not to break bisection). Honza -- Jan Kara SUSE Labs, CR