From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D85F8C433EF for ; Fri, 3 Sep 2021 19:05:24 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 39E6F60E93 for ; Fri, 3 Sep 2021 19:05:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 39E6F60E93 Authentication-Results: mail.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630695923; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=t63C2E0njS3Hq3kFCwds3/zbseK1hcdenGTWWTBplsA=; b=IjjHcRlma2oOn8y32Qem7QWh6k2AuI93zr2V4AUhZUcc3/SI1gFB+/xwx5X3/iGZB2yxud LegvRVWBnFTni1q/GJGZvqYphG3LkBgz+5vI1u56uWPvI4AEFSxy/WY6ErOSb+3/JW/w/6 gPaekoDq4UL4+x3qZbJqesdqGanbdXo= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-491-nKkvIi31NPCr7oL3vU0OLA-1; Fri, 03 Sep 2021 15:05:21 -0400 X-MC-Unique: nKkvIi31NPCr7oL3vU0OLA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 449421006C91; Fri, 3 Sep 2021 19:05:18 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 81D7860BF1; Fri, 3 Sep 2021 19:05:17 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 30D6D44A5A; Fri, 3 Sep 2021 19:05:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 183IxAks019440 for ; Fri, 3 Sep 2021 14:59:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id B4A875C1C5; Fri, 3 Sep 2021 18:59:10 +0000 (UTC) Received: from madcap2.tricolour.ca (unknown [10.3.128.14]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 05D915C1B4; Fri, 3 Sep 2021 18:58:59 +0000 (UTC) Date: Fri, 3 Sep 2021 14:58:57 -0400 From: Richard Guy Briggs To: Christophe Leroy Subject: Re: [PATCH] audit: Fix build failure by renaming struct node to struct audit_node Message-ID: <20210903185857.GI490529@madcap2.tricolour.ca> References: <4e2370a9022495c49f3108fe34c5a2b2f4b28dfa.1630684009.git.christophe.leroy@csgroup.eu> MIME-Version: 1.0 In-Reply-To: <4e2370a9022495c49f3108fe34c5a2b2f4b28dfa.1630684009.git.christophe.leroy@csgroup.eu> User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: linux-audit@redhat.com Cc: linux-audit@redhat.com, Eric Paris , linux-kernel@vger.kernel.org X-BeenThere: linux-audit@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Linux Audit Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-audit-bounces@redhat.com Errors-To: linux-audit-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=linux-audit-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On 2021-09-03 15:48, Christophe Leroy wrote: > struct node defined in kernel/audit_tree.c conflicts with > struct node defined in include/linux/node.h Why? What changed to start triggering this error? This code has been here for 15 years. I am guessing changing the other one would affect more code? The patch itself looks fine to me. Reviewed-by: Richard Guy Briggs > CC kernel/audit_tree.o > kernel/audit_tree.c:33:9: error: redefinition of 'struct node' > 33 | struct node { > | ^~~~ > In file included from ./include/linux/cpu.h:17, > from ./include/linux/static_call.h:102, > from ./arch/powerpc/include/asm/machdep.h:10, > from ./arch/powerpc/include/asm/archrandom.h:7, > from ./include/linux/random.h:121, > from ./include/linux/net.h:18, > from ./include/linux/skbuff.h:26, > from kernel/audit.h:11, > from kernel/audit_tree.c:2: > ./include/linux/node.h:84:8: note: originally defined here > 84 | struct node { > | ^~~~ > make[2]: *** [kernel/audit_tree.o] Error 1 > > Rename it audit_node. > > Signed-off-by: Christophe Leroy > --- > kernel/audit_tree.c | 20 ++++++++++---------- > 1 file changed, 10 insertions(+), 10 deletions(-) > > diff --git a/kernel/audit_tree.c b/kernel/audit_tree.c > index b2be4e978ba3..d392cf4ec8e2 100644 > --- a/kernel/audit_tree.c > +++ b/kernel/audit_tree.c > @@ -30,7 +30,7 @@ struct audit_chunk { > int count; > atomic_long_t refs; > struct rcu_head head; > - struct node { > + struct audit_node { > struct list_head list; > struct audit_tree *owner; > unsigned index; /* index; upper bit indicates 'will prune' */ > @@ -269,7 +269,7 @@ bool audit_tree_match(struct audit_chunk *chunk, struct audit_tree *tree) > > /* tagging and untagging inodes with trees */ > > -static struct audit_chunk *find_chunk(struct node *p) > +static struct audit_chunk *find_chunk(struct audit_node *p) > { > int index = p->index & ~(1U<<31); > p -= index; > @@ -322,7 +322,7 @@ static void replace_chunk(struct audit_chunk *new, struct audit_chunk *old) > list_replace_rcu(&old->hash, &new->hash); > } > > -static void remove_chunk_node(struct audit_chunk *chunk, struct node *p) > +static void remove_chunk_node(struct audit_chunk *chunk, struct audit_node *p) > { > struct audit_tree *owner = p->owner; > > @@ -459,7 +459,7 @@ static int tag_chunk(struct inode *inode, struct audit_tree *tree) > { > struct fsnotify_mark *mark; > struct audit_chunk *chunk, *old; > - struct node *p; > + struct audit_node *p; > int n; > > mutex_lock(&audit_tree_group->mark_mutex); > @@ -570,11 +570,11 @@ static void prune_tree_chunks(struct audit_tree *victim, bool tagged) > { > spin_lock(&hash_lock); > while (!list_empty(&victim->chunks)) { > - struct node *p; > + struct audit_node *p; > struct audit_chunk *chunk; > struct fsnotify_mark *mark; > > - p = list_first_entry(&victim->chunks, struct node, list); > + p = list_first_entry(&victim->chunks, struct audit_node, list); > /* have we run out of marked? */ > if (tagged && !(p->index & (1U<<31))) > break; > @@ -616,7 +616,7 @@ static void trim_marked(struct audit_tree *tree) > } > /* reorder */ > for (p = tree->chunks.next; p != &tree->chunks; p = q) { > - struct node *node = list_entry(p, struct node, list); > + struct audit_node *node = list_entry(p, struct audit_node, list); > q = p->next; > if (node->index & (1U<<31)) { > list_del_init(p); > @@ -684,7 +684,7 @@ void audit_trim_trees(void) > struct audit_tree *tree; > struct path path; > struct vfsmount *root_mnt; > - struct node *node; > + struct audit_node *node; > int err; > > tree = container_of(cursor.next, struct audit_tree, list); > @@ -839,7 +839,7 @@ int audit_add_tree_rule(struct audit_krule *rule) > drop_collected_mounts(mnt); > > if (!err) { > - struct node *node; > + struct audit_node *node; > spin_lock(&hash_lock); > list_for_each_entry(node, &tree->chunks, list) > node->index &= ~(1U<<31); > @@ -938,7 +938,7 @@ int audit_tag_tree(char *old, char *new) > mutex_unlock(&audit_filter_mutex); > > if (!failed) { > - struct node *node; > + struct audit_node *node; > spin_lock(&hash_lock); > list_for_each_entry(node, &tree->chunks, list) > node->index &= ~(1U<<31); > -- > 2.25.0 > > -- > Linux-audit mailing list > Linux-audit@redhat.com > https://listman.redhat.com/mailman/listinfo/linux-audit > - RGB -- Richard Guy Briggs Sr. S/W Engineer, Kernel Security, Base Operating Systems Remote, Ottawa, Red Hat Canada IRC: rgb, SunRaycer Voice: +1.647.777.2635, Internal: (81) 32635 -- Linux-audit mailing list Linux-audit@redhat.com https://listman.redhat.com/mailman/listinfo/linux-audit