Message ID | 20221211092820.85527-1-code@siddh.me |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1696410wrr; Sun, 11 Dec 2022 01:55:01 -0800 (PST) X-Google-Smtp-Source: AA0mqf7q8riAGCCdkE47Z9dQyCg2ZIvWX2EWZIj+kKfTArnufm+/6cgpoHxA9Sowb7L4flFkVkDc X-Received: by 2002:a17:906:4e44:b0:7c0:f7b2:b19a with SMTP id g4-20020a1709064e4400b007c0f7b2b19amr9538298ejw.27.1670752501137; Sun, 11 Dec 2022 01:55:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1670752501; cv=pass; d=google.com; s=arc-20160816; b=mWWih84p+aNtpa6NTm/egAt3MSukQ2U7SEnbZ7RDoZ4l4pxF1E16lw1b7re6qjyEjx B5yzVHvH3g1vMzYOWmq3EvTJjsKjs1kgvihK06QcGyrDWSZnOn4TkDqC+tu5Qyzt+hXr 7qZrvlN2cSDsDO/SQQImrIulqKFbpv7DLuWLZN5o5paJCzCZIB5DaMllhL5ca5ItjHPg gcwveDf/JrU0T+EenIV3YDaL/NASEo/JMd7D5mQZnxcF9YE6466rFV++vWqEo1cCNimM xj7lqm06SuOEALEKVbZW6yv5c+2oNPV4S6SU3oV/LaB+9Gd35bgta2i6998JmwhaPbm8 5yOw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version:date :subject:message-id:cc:to:from:dkim-signature; bh=Xkq9oi0Kqa5o104HB6937If/FFeLhwwTtuDxZaE+Zqc=; b=JXuBeUDTA/Tk5JfRi4PIYLKd1laNvkV9vun56XpdmDNRlGJhGdOubHCYkiuJYT9zXe K6fMug5KLO7zxJ8q5tPz+/zUMcWyX3zX+YiAupxAWeTUeS5k2vE4TY5xZlNKgafBCyrw c2F/j810sgE6Pn9HcvoSEFI5WPSalNj+F29MKz97bsBgRfsPhY39HoB72O7ImCj1jRi5 If9SGcnLEuYKzThrhNNym3Ip0PtQL1JZj14oclZFbilixI9eaf9XlsUr9uese8G+7SYk 8TBOSuNnjVBK37ONHEyuS2Ww4+RWk4KOG4VTlA/c4Bu4jt9woafHm4cHBBLDDoEVvzCf EdoA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@siddh.me header.s=zmail header.b=JaFqXGIT; arc=pass (i=1 spf=pass spfdomain=siddh.me dkim=pass dkdomain=siddh.me dmarc=pass fromdomain=siddh.me>); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siddh.me Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lc13-20020a170906dfed00b007c146656542si3162508ejc.304.2022.12.11.01.54.32; Sun, 11 Dec 2022 01:55:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@siddh.me header.s=zmail header.b=JaFqXGIT; arc=pass (i=1 spf=pass spfdomain=siddh.me dkim=pass dkdomain=siddh.me dmarc=pass fromdomain=siddh.me>); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siddh.me Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230037AbiLKJ2s (ORCPT <rfc822;jeantsuru.cumc.mandola@gmail.com> + 99 others); Sun, 11 Dec 2022 04:28:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230026AbiLKJ2o (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 11 Dec 2022 04:28:44 -0500 Received: from sender-of-o50.zoho.in (sender-of-o50.zoho.in [103.117.158.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA794DFE1; Sun, 11 Dec 2022 01:28:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670750905; cv=none; d=zohomail.in; s=zohoarc; b=cQkedRHhiBcjvDmL5SSj3EN64o2w3Gdj4WQMOf5RefBfQMjq/+8+W3nedGE85dJreENyBpyyy6iC+XXF3/SDAC9xPJ9gtr/CoF5lM9hvftcJmTm/jQ6AxJyDO5OkK58+fUo9m5lalB1JrBySAs8sKfAAhQrEpIKVilEFcLSR2fc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.in; s=zohoarc; t=1670750905; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:MIME-Version:Message-ID:Subject:To; bh=Xkq9oi0Kqa5o104HB6937If/FFeLhwwTtuDxZaE+Zqc=; b=BmvVCaLPZNXJPRRR8p8V21FhXHRjWLtxnX1kvMyxp67EI9JohzrjT6viQohiV0vLPJEizk59EokjXMnZ/BsQkjYFS9tsi077ahmtbcgizXDM6K/DmvVTWqTWZcYZYMxNgV3XAAM2jJU4U8WE2TU0CjTohBZs60HrGWgpw+VQy5w= ARC-Authentication-Results: i=1; mx.zohomail.in; dkim=pass header.i=siddh.me; spf=pass smtp.mailfrom=code@siddh.me; dmarc=pass header.from=<code@siddh.me> DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1670750905; s=zmail; d=siddh.me; i=code@siddh.me; h=From:From:To:To:Cc:Cc:Message-ID:Subject:Subject:Date:Date:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To; bh=Xkq9oi0Kqa5o104HB6937If/FFeLhwwTtuDxZaE+Zqc=; b=JaFqXGITxG+8CXPDWBNTgz3m6SybcsAHvkQOzRwpwLfpjAZI6lGKfCwH6hIlbdAR YyKYElShH/6sH2X1xmvZe5hyjtFmSYfcSY/C2fjGTOr4lx2S8TMV05mwBpvP1BjNcON l6ZLI5y4f+pF6Wj+3mZuV2EVcggZE12q6iZd+VEU= Received: from kampyooter.. (110.226.31.37 [110.226.31.37]) by mx.zoho.in with SMTPS id 1670750904303896.6418334535564; Sun, 11 Dec 2022 14:58:24 +0530 (IST) From: Siddh Raman Pant <code@siddh.me> To: Christian Brauner <brauner@kernel.org>, Seth Forshee <sforshee@kernel.org>, Shuah Khan <shuah@kernel.org> Cc: linux-fsdevel <linux-fsdevel@vger.kernel.org>, linux-kselftests <linux-kselftest@vger.kernel.org>, linux-kernel <linux-kernel@vger.kernel.org> Message-ID: <20221211092820.85527-1-code@siddh.me> Subject: [PATCH] selftests/mount_setattr: Remove redefinition of struct mount_attr Date: Sun, 11 Dec 2022 14:58:20 +0530 X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-ZohoMailClient: External X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751910974351379408?= X-GMAIL-MSGID: =?utf-8?q?1751910974351379408?= |
Series |
selftests/mount_setattr: Remove redefinition of struct mount_attr
|
|
Commit Message
Siddh Raman Pant
Dec. 11, 2022, 9:28 a.m. UTC
It is already included via sys/mount.h on line 10.
GCC error reproducible by: make kselftest TARGETS="mount_setattr"
mount_setattr_test.c:107:8: error: redefinition of ‘struct mount_attr’
107 | struct mount_attr {
| ^~~~~~~~~~
In file included from /usr/include/x86_64-linux-gnu/sys/mount.h:32,
from mount_setattr_test.c:10:
../../../../usr/include/linux/mount.h:129:8: note: originally defined here
129 | struct mount_attr {
| ^~~~~~~~~~
Signed-off-by: Siddh Raman Pant <code@siddh.me>
---
tools/testing/selftests/mount_setattr/mount_setattr_test.c | 7 -------
1 file changed, 7 deletions(-)
Comments
On Sun, 11 Dec 2022 14:58:20 +0530, Siddh Raman Pant wrote: > It is already included via sys/mount.h on line 10. > > GCC error reproducible by: make kselftest TARGETS="mount_setattr" > > mount_setattr_test.c:107:8: error: redefinition of ‘struct mount_attr’ > 107 | struct mount_attr { > | ^~~~~~~~~~ > In file included from /usr/include/x86_64-linux-gnu/sys/mount.h:32, > from mount_setattr_test.c:10: > ../../../../usr/include/linux/mount.h:129:8: note: originally defined here > 129 | struct mount_attr { > | ^~~~~~~~~~ > > Signed-off-by: Siddh Raman Pant <code@siddh.me> > --- > tools/testing/selftests/mount_setattr/mount_setattr_test.c | 7 ------- > 1 file changed, 7 deletions(-) > > diff --git a/tools/testing/selftests/mount_setattr/mount_setattr_test.c b/tools/testing/selftests/mount_setattr/mount_setattr_test.c > index 8c5fea68ae67..582669ca38e9 100644 > --- a/tools/testing/selftests/mount_setattr/mount_setattr_test.c > +++ b/tools/testing/selftests/mount_setattr/mount_setattr_test.c > @@ -103,13 +103,6 @@ > #else > #define __NR_mount_setattr 442 > #endif > - > -struct mount_attr { > - __u64 attr_set; > - __u64 attr_clr; > - __u64 propagation; > - __u64 userns_fd; > -}; > #endif > > #ifndef __NR_open_tree > -- > 2.35.1 Hi, Please review the above patch, which can be found on the link below: https://lore.kernel.org/all/20221211092820.85527-1-code@siddh.me This was encountered before the patch adding missing <sys/syscall.h> was applied, which just means that I went into the code path under #ifndef __NR_mount_setattr, and encountered the error. Thanks, Siddh
On Sun, Dec 11, 2022 at 02:58:20PM +0530, Siddh Raman Pant wrote: > It is already included via sys/mount.h on line 10. > > GCC error reproducible by: make kselftest TARGETS="mount_setattr" > > mount_setattr_test.c:107:8: error: redefinition of ‘struct mount_attr’ > 107 | struct mount_attr { > | ^~~~~~~~~~ > In file included from /usr/include/x86_64-linux-gnu/sys/mount.h:32, > from mount_setattr_test.c:10: > ../../../../usr/include/linux/mount.h:129:8: note: originally defined here > 129 | struct mount_attr { > | ^~~~~~~~~~ > > Signed-off-by: Siddh Raman Pant <code@siddh.me> > --- > tools/testing/selftests/mount_setattr/mount_setattr_test.c | 7 ------- > 1 file changed, 7 deletions(-) > > diff --git a/tools/testing/selftests/mount_setattr/mount_setattr_test.c b/tools/testing/selftests/mount_setattr/mount_setattr_test.c > index 8c5fea68ae67..582669ca38e9 100644 > --- a/tools/testing/selftests/mount_setattr/mount_setattr_test.c > +++ b/tools/testing/selftests/mount_setattr/mount_setattr_test.c > @@ -103,13 +103,6 @@ > #else > #define __NR_mount_setattr 442 > #endif > - > -struct mount_attr { > - __u64 attr_set; > - __u64 attr_clr; > - __u64 propagation; > - __u64 userns_fd; > -}; > #endif Honestly, until the conflicts between linux/mount.h and sys/mount.h are fixed properly we should probably just not include either linux/mount.h nor sys/mount.h and just define all the things we need in this single test file.
diff --git a/tools/testing/selftests/mount_setattr/mount_setattr_test.c b/tools/testing/selftests/mount_setattr/mount_setattr_test.c index 8c5fea68ae67..582669ca38e9 100644 --- a/tools/testing/selftests/mount_setattr/mount_setattr_test.c +++ b/tools/testing/selftests/mount_setattr/mount_setattr_test.c @@ -103,13 +103,6 @@ #else #define __NR_mount_setattr 442 #endif - -struct mount_attr { - __u64 attr_set; - __u64 attr_clr; - __u64 propagation; - __u64 userns_fd; -}; #endif #ifndef __NR_open_tree