From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de ([195.135.220.15]:36444 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727387AbeGPPlp (ORCPT ); Mon, 16 Jul 2018 11:41:45 -0400 Date: Mon, 16 Jul 2018 17:13:52 +0200 From: Jan Kara To: Amir Goldstein Cc: Jan Kara , Linux Audit , Paul Moore , linux-fsdevel , Al Viro , Richard Guy Briggs Subject: Re: [PATCH 09/10] audit: Allocate fsnotify mark independently of chunk Message-ID: <20180716151352.vqw43lcf4e7zmk55@quack2.suse.cz> References: <20180710100217.12866-1-jack@suse.cz> <20180710100217.12866-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 11-07-18 13:48:58, Amir Goldstein wrote: > On Wed, Jul 11, 2018 at 11:57 AM, Amir Goldstein wrote: > > On Tue, Jul 10, 2018 at 1:02 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 > > > > Ack. > > Found minor nit. > > [...] > >> +static inline struct audit_tree_mark *AUDIT_M(struct fsnotify_mark *entry) > >> +{ > >> + return container_of(entry, struct audit_tree_mark, fsn_mark); > >> +} > >> + > >> static void audit_tree_destroy_watch(struct fsnotify_mark *entry) > >> { > >> - struct audit_chunk *chunk = container_of(entry, struct audit_chunk, mark); > >> + struct audit_chunk *chunk = AUDIT_M(entry)->chunk; > >> audit_mark_put_chunk(chunk); > >> + kmem_cache_free(audit_tree_mark_cachep, entry); > > Technically, we should be freeing AUDIT_M(entry) > although it is the same address with current struct layout. Right, thanks for spotting this. Fixed in my tree. Honza -- Jan Kara SUSE Labs, CR