From patchwork Fri Aug 5 06:34:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Li Wang X-Patchwork-Id: 1663919 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=NmEjtreo; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it (client-ip=213.254.12.146; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LzbRF3t88z9s1l for ; Fri, 5 Aug 2022 16:34:17 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 128503C941D for ; Fri, 5 Aug 2022 08:34:15 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-5.smtp.seeweb.it (in-5.smtp.seeweb.it [IPv6:2001:4b78:1:20::5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id D49633C1BDC for ; Fri, 5 Aug 2022 08:34:12 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by in-5.smtp.seeweb.it (Postfix) with ESMTPS id 4939260100C for ; Fri, 5 Aug 2022 08:34:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1659681250; h=from:from: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; bh=BWueao5oafEDb3+BKpe2SwU/+DhDLFIlgFlf1e9JC8s=; b=NmEjtreoYfix9WGb+k01Cm29JVuJu0wlwt2jJsTyOPXTP/k5RcAqI3RuiNTwIWezGzAn34 kyJtBdzN0lYxKpLlq/tdYysj3m8NMLvJKV7QBuRkDpL8HEmyJ1pmiFic6wGjG24vNBn78T zxS6XAx9/Fm6ie0P2alOLMRSNj7BmCc= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-21-iNEJhpX7MM66cL9FTJdpig-1; Fri, 05 Aug 2022 02:34:07 -0400 X-MC-Unique: iNEJhpX7MM66cL9FTJdpig-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B16F81857F02; Fri, 5 Aug 2022 06:34:06 +0000 (UTC) Received: from liwang-workstation.nay.redhat.com (dhcp-66-81-187.nay.redhat.com [10.66.81.187]) by smtp.corp.redhat.com (Postfix) with ESMTP id 786F41415122; Fri, 5 Aug 2022 06:34:05 +0000 (UTC) From: Li Wang To: ltp@lists.linux.it Date: Fri, 5 Aug 2022 14:34:00 +0800 Message-Id: <20220805063401.1647479-2-liwang@redhat.com> In-Reply-To: <20220805063401.1647479-1-liwang@redhat.com> References: <20220805063401.1647479-1-liwang@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Virus-Scanned: clamav-milter 0.102.4 at in-5.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on in-5.smtp.seeweb.it Subject: [LTP] [PATCH 1/2] lapi/pidfd: adding pidfd header file X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" The newer Glibc already provided wrapper for the series pidfd syscall, so let's include the header file conditionally. # rpm -q glibc-devel glibc-devel-2.35.9000-31.fc37.ppc64le # rpm -ql glibc-devel | grep pidfd /usr/include/sys/pidfd.h To get rid of compiling error from fedora-rawhide: tst_safe_macros.c: In function ‘safe_pidfd_open’: tst_safe_macros.c:135:16: error: implicit declaration of function ‘pidfd_open’ [-Werror=implicit-function-declaration] 135 | rval = pidfd_open(pid, flags); | ^~~~~~~~~~ Signed-off-by: Li Wang --- configure.ac | 1 + include/lapi/pidfd.h | 3 +++ 2 files changed, 4 insertions(+) diff --git a/configure.ac b/configure.ac index 69b145b5f..d50ec1ea7 100644 --- a/configure.ac +++ b/configure.ac @@ -71,6 +71,7 @@ AC_CHECK_HEADERS_ONCE([ \ sys/epoll.h \ sys/fanotify.h \ sys/inotify.h \ + sys/pidfd.h sys/prctl.h \ sys/shm.h \ sys/timerfd.h \ diff --git a/include/lapi/pidfd.h b/include/lapi/pidfd.h index 244d3acaf..9ca8e5aa2 100644 --- a/include/lapi/pidfd.h +++ b/include/lapi/pidfd.h @@ -8,6 +8,9 @@ #define LAPI_PIDFD_H__ #include +#ifdef HAVE_SYS_PIDFD_H +# include +#endif #include "config.h" #include "lapi/syscalls.h" From patchwork Fri Aug 5 06:34:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Wang X-Patchwork-Id: 1663921 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=cSYlcf6z; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it (client-ip=213.254.12.146; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LzbRf4Z7Mz9s1l for ; Fri, 5 Aug 2022 16:34:38 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 286E93C9428 for ; Fri, 5 Aug 2022 08:34:36 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-6.smtp.seeweb.it (in-6.smtp.seeweb.it [217.194.8.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id 796E53C1BDC for ; Fri, 5 Aug 2022 08:34:13 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by in-6.smtp.seeweb.it (Postfix) with ESMTPS id 93A181400332 for ; Fri, 5 Aug 2022 08:34:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1659681251; h=from:from: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; bh=PAVyQVLr7sYQgBnKjv/qZ1+WBmmI6WacqH0YM62Wypw=; b=cSYlcf6zDaKNhS0NJxh22ZDe9EnODpeuWzEQlAsLNdM8tPLkjr+0ptDlwC61kS1GIh4ro+ Zj6b5nBn0W7cxVuPrjthYL16Ufyk0GmzUVHZqmfc1sRdXzIf/lSZOY9Wxc3kuFUilN2toj TIhCMw9a/dui41NH+y/vFjs7fsIsyAE= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-613-Ow4nw6RyO_uL1Pxn4xNixg-1; Fri, 05 Aug 2022 02:34:08 -0400 X-MC-Unique: Ow4nw6RyO_uL1Pxn4xNixg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 89EB2802D1C; Fri, 5 Aug 2022 06:34:08 +0000 (UTC) Received: from liwang-workstation.nay.redhat.com (dhcp-66-81-187.nay.redhat.com [10.66.81.187]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5121C1415122; Fri, 5 Aug 2022 06:34:07 +0000 (UTC) From: Li Wang To: ltp@lists.linux.it Date: Fri, 5 Aug 2022 14:34:01 +0800 Message-Id: <20220805063401.1647479-3-liwang@redhat.com> In-Reply-To: <20220805063401.1647479-1-liwang@redhat.com> References: <20220805063401.1647479-1-liwang@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Virus-Scanned: clamav-milter 0.102.4 at in-6.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on in-6.smtp.seeweb.it Subject: [LTP] [PATCH 2/2] lapi/fsmount: resolve conflict in different header files X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" The latest glibc added new wrappers (e.g. mount_setattr, fsopen) support in sys/mount.h, which partly conflicts with linux/mount.h at the same time. We need to make adjustments to header files to fix compiling error on different platforms. Signed-off-by: Li Wang Reviewed-by: Petr Vorel --- configure.ac | 1 + include/lapi/fs.h | 6 ++++-- include/lapi/fsmount.h | 6 ++++-- testcases/kernel/syscalls/fsconfig/fsconfig01.c | 1 + testcases/kernel/syscalls/fsconfig/fsconfig02.c | 1 + testcases/kernel/syscalls/fsmount/fsmount01.c | 1 + testcases/kernel/syscalls/fsmount/fsmount02.c | 1 + testcases/kernel/syscalls/fsopen/fsopen01.c | 1 + testcases/kernel/syscalls/fsopen/fsopen02.c | 1 + testcases/kernel/syscalls/fspick/fspick01.c | 1 + testcases/kernel/syscalls/fspick/fspick02.c | 1 + testcases/kernel/syscalls/mount_setattr/mount_setattr01.c | 1 + testcases/kernel/syscalls/move_mount/move_mount01.c | 1 + testcases/kernel/syscalls/move_mount/move_mount02.c | 1 + testcases/kernel/syscalls/open_tree/open_tree01.c | 1 + testcases/kernel/syscalls/open_tree/open_tree02.c | 1 + 16 files changed, 22 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index d50ec1ea7..dbd53cab6 100644 --- a/configure.ac +++ b/configure.ac @@ -113,6 +113,7 @@ AC_CHECK_FUNCS_ONCE([ \ mkdirat \ mknodat \ modify_ldt \ + mount_setattr \ move_mount \ name_to_handle_at \ open_tree \ diff --git a/include/lapi/fs.h b/include/lapi/fs.h index 27b3a183c..84a168a67 100644 --- a/include/lapi/fs.h +++ b/include/lapi/fs.h @@ -6,8 +6,10 @@ * Email: code@zilogic.com */ -#ifdef HAVE_LINUX_FS_H -# include +#ifndef HAVE_MOUNT_SETATTR +# ifdef HAVE_LINUX_FS_H +# include +# endif #endif #include diff --git a/include/lapi/fsmount.h b/include/lapi/fsmount.h index b11e7a7bd..9b1993580 100644 --- a/include/lapi/fsmount.h +++ b/include/lapi/fsmount.h @@ -12,8 +12,10 @@ #include #include -#ifdef HAVE_LINUX_MOUNT_H -# include +#ifndef HAVE_FSOPEN +# ifdef HAVE_LINUX_MOUNT_H +# include +# endif #endif #include "lapi/fcntl.h" diff --git a/testcases/kernel/syscalls/fsconfig/fsconfig01.c b/testcases/kernel/syscalls/fsconfig/fsconfig01.c index a585daa6d..f1dc7d8da 100644 --- a/testcases/kernel/syscalls/fsconfig/fsconfig01.c +++ b/testcases/kernel/syscalls/fsconfig/fsconfig01.c @@ -5,6 +5,7 @@ * Basic fsconfig() test which tries to configure and mount the filesystem as * well. */ +#include #include "tst_test.h" #include "lapi/fsmount.h" diff --git a/testcases/kernel/syscalls/fsconfig/fsconfig02.c b/testcases/kernel/syscalls/fsconfig/fsconfig02.c index 272e25a6f..bbad6def6 100644 --- a/testcases/kernel/syscalls/fsconfig/fsconfig02.c +++ b/testcases/kernel/syscalls/fsconfig/fsconfig02.c @@ -4,6 +4,7 @@ * * Basic fsconfig() failure tests. */ +#include #include "tst_test.h" #include "lapi/fsmount.h" diff --git a/testcases/kernel/syscalls/fsmount/fsmount01.c b/testcases/kernel/syscalls/fsmount/fsmount01.c index 5f755863f..1232b0914 100644 --- a/testcases/kernel/syscalls/fsmount/fsmount01.c +++ b/testcases/kernel/syscalls/fsmount/fsmount01.c @@ -6,6 +6,7 @@ * Basic fsmount() test. */ +#include #include "tst_test.h" #include "lapi/fsmount.h" diff --git a/testcases/kernel/syscalls/fsmount/fsmount02.c b/testcases/kernel/syscalls/fsmount/fsmount02.c index a4f42dc18..91512b74a 100644 --- a/testcases/kernel/syscalls/fsmount/fsmount02.c +++ b/testcases/kernel/syscalls/fsmount/fsmount02.c @@ -4,6 +4,7 @@ * * Basic fsmount() failure tests. */ +#include #include "tst_test.h" #include "lapi/fsmount.h" diff --git a/testcases/kernel/syscalls/fsopen/fsopen01.c b/testcases/kernel/syscalls/fsopen/fsopen01.c index c2c719c96..332821cf0 100644 --- a/testcases/kernel/syscalls/fsopen/fsopen01.c +++ b/testcases/kernel/syscalls/fsopen/fsopen01.c @@ -5,6 +5,7 @@ * Basic fsopen() test which tries to configure and mount the filesystem as * well. */ +#include #include "tst_test.h" #include "lapi/fsmount.h" diff --git a/testcases/kernel/syscalls/fsopen/fsopen02.c b/testcases/kernel/syscalls/fsopen/fsopen02.c index 3f287bf29..8c643b9a8 100644 --- a/testcases/kernel/syscalls/fsopen/fsopen02.c +++ b/testcases/kernel/syscalls/fsopen/fsopen02.c @@ -4,6 +4,7 @@ * * Basic fsopen() failure tests. */ +#include #include "tst_test.h" #include "lapi/fsmount.h" diff --git a/testcases/kernel/syscalls/fspick/fspick01.c b/testcases/kernel/syscalls/fspick/fspick01.c index d3309a912..ae6cad6fb 100644 --- a/testcases/kernel/syscalls/fspick/fspick01.c +++ b/testcases/kernel/syscalls/fspick/fspick01.c @@ -4,6 +4,7 @@ * * Basic fspick() test. */ +#include #include "tst_test.h" #include "lapi/fsmount.h" diff --git a/testcases/kernel/syscalls/fspick/fspick02.c b/testcases/kernel/syscalls/fspick/fspick02.c index f9a3697c1..907b463b6 100644 --- a/testcases/kernel/syscalls/fspick/fspick02.c +++ b/testcases/kernel/syscalls/fspick/fspick02.c @@ -4,6 +4,7 @@ * * Basic fspick() failure tests. */ +#include #include "tst_test.h" #include "lapi/fsmount.h" diff --git a/testcases/kernel/syscalls/mount_setattr/mount_setattr01.c b/testcases/kernel/syscalls/mount_setattr/mount_setattr01.c index 83746b878..fcf491c33 100644 --- a/testcases/kernel/syscalls/mount_setattr/mount_setattr01.c +++ b/testcases/kernel/syscalls/mount_setattr/mount_setattr01.c @@ -30,6 +30,7 @@ #define _GNU_SOURCE #include +#include #include "tst_test.h" #include "lapi/fsmount.h" #include "lapi/stat.h" diff --git a/testcases/kernel/syscalls/move_mount/move_mount01.c b/testcases/kernel/syscalls/move_mount/move_mount01.c index 445e6197e..b65141a28 100644 --- a/testcases/kernel/syscalls/move_mount/move_mount01.c +++ b/testcases/kernel/syscalls/move_mount/move_mount01.c @@ -4,6 +4,7 @@ * * Basic move_mount() test. */ +#include #include "tst_test.h" #include "lapi/fsmount.h" diff --git a/testcases/kernel/syscalls/move_mount/move_mount02.c b/testcases/kernel/syscalls/move_mount/move_mount02.c index 45b1db4be..373c8c3ac 100644 --- a/testcases/kernel/syscalls/move_mount/move_mount02.c +++ b/testcases/kernel/syscalls/move_mount/move_mount02.c @@ -4,6 +4,7 @@ * * Basic move_mount() failure tests. */ +#include #include "tst_test.h" #include "lapi/fsmount.h" diff --git a/testcases/kernel/syscalls/open_tree/open_tree01.c b/testcases/kernel/syscalls/open_tree/open_tree01.c index 808d25665..6d2299449 100644 --- a/testcases/kernel/syscalls/open_tree/open_tree01.c +++ b/testcases/kernel/syscalls/open_tree/open_tree01.c @@ -4,6 +4,7 @@ * * Basic open_tree() test. */ +#include #include "tst_test.h" #include "lapi/fsmount.h" diff --git a/testcases/kernel/syscalls/open_tree/open_tree02.c b/testcases/kernel/syscalls/open_tree/open_tree02.c index ddaa204f2..59a5a4ca2 100644 --- a/testcases/kernel/syscalls/open_tree/open_tree02.c +++ b/testcases/kernel/syscalls/open_tree/open_tree02.c @@ -4,6 +4,7 @@ * * Basic open_tree() failure tests. */ +#include #include "tst_test.h" #include "lapi/fsmount.h"