m4: remove useless ltp-securebits.m4
PATCH 1/1 m4: remove useless ltp-securebits.m4
Since commit fe9d9218c, we have detected linux/securebits.h in confiure.ac. one place used the HAVE_SECUREBITS(ltp-securebits.m4 defined), it only controls compile. kernel/security/securebits/ check_keepcaps.c has HAVE_LINUX_SECUREBITS_H check in internal, so removing it is safe.
--- configure.ac | 1 - include/mk/features.mk.default | 3 --- include/mk/features.mk.in | 3 --- m4/ltp-securebits.m4 | 10 ---------- testcases/kernel/security/Makefile | 4 ---- 5 files changed, 21 deletions(-) delete mode 100644 m4/ltp-securebits.m4
configure.ac +0 -1
@@ -226,7 +226,6 @@ LTP_CHECK_NOMMU_LINUX LTP_CHECK_PERF_EVENT LTP_CHECK_PRCTL_SUPPORT LTP_CHECK_RLIMIT64 -LTP_CHECK_SECUREBITS LTP_CHECK_SELINUX LTP_CHECK_SIGNAL LTP_CHECK_STATX
include/mk/features.mk.default +0 -3
@@ -29,9 +29,6 @@ WITH_PYTHON := no # Features knobs -# Is securebits[.h], et all support available? -HAVE_SECUREBITS := no - # Test suite knobs # Enable testcases/kernel/power_management's compile and install?
include/mk/features.mk.in +0 -3
@@ -29,9 +29,6 @@ WITH_PYTHON := @WITH_PYTHON@ # Features knobs -# Is securebits[.h], et all support available? -HAVE_SECUREBITS := @HAVE_SECUREBITS@ - # Test suite knobs # Enable testcases/kernel/power_management's compile and install?
m4/ltp-securebits.m4 deleted +0 -10
@@ -1,10 +0,0 @@ -dnl SPDX-License-Identifier: GPL-2.0-or-later -dnl Copyright (c) Serge Hallyn (2010) - -AC_DEFUN([LTP_CHECK_SECUREBITS],[ - AC_CHECK_HEADERS(linux/securebits.h,[have_securebits=yes]) -if test "x$have_securebits" != xyes; then - have_securebits=no -fi -AC_SUBST(HAVE_SECUREBITS,$have_securebits) -])
testcases/kernel/security/Makefile +0 -4
@@ -24,10 +24,6 @@ top_srcdir ?= ../../.. include $(top_srcdir)/include/mk/env_pre.mk -ifneq ($(HAVE_SECUREBITS),yes) -FILTER_OUT_DIRS += securebits -endif - OPT_CFLAGS += -O DEBUG_LDFLAGS += -s
Signature · 1 line
2.18.1
PATCH 1/1 m4: remove useless ltp-securebits.m4
Hi Xu,
LGTM. :-)
Best Regards,
Xiao Yang
Quoted 87 lines · Yang Xu
Since commit
fe9d9218c, we have detectedlinux/securebits.hin confiure.ac. one place used theHAVE_SECUREBITS(ltp-securebits.m4 defined), it only controls compile.kernel/security/securebits/check_keepcaps.chasHAVE_LINUX_SECUREBITS_Hcheck in internal, so removing it is safe.Signed-off-by Yang Xu <[email protected]>--- configure.ac | 1 - include/mk/features.mk.default | 3 --- include/mk/features.mk.in | 3 --- m4/ltp-securebits.m4 | 10 ---------- testcases/kernel/security/Makefile | 4 ---- 5 files changed, 21 deletions(-)delete mode 100644 m4/ltp-securebits.m4
configure.ac +0
-1@@ -226,7 +226,6 @@ LTP_CHECK_NOMMU_LINUX LTP_CHECK_PERF_EVENT LTP_CHECK_PRCTL_SUPPORT LTP_CHECK_RLIMIT64 -LTP_CHECK_SECUREBITS LTP_CHECK_SELINUX LTP_CHECK_SIGNAL LTP_CHECK_STATXinclude/mk/features.mk.default +0
-3@@ -29,9 +29,6 @@ WITH_PYTHON := no # Features knobs -# Is securebits[.h], et all support available? -HAVE_SECUREBITS := no - # Test suite knobs # Enable testcases/kernel/power_management's compile and install?include/mk/features.mk.in +0
-3@@ -29,9 +29,6 @@ WITH_PYTHON := @WITH_PYTHON@ # Features knobs -# Is securebits[.h], et all support available? -HAVE_SECUREBITS := @HAVE_SECUREBITS@ - # Test suite knobs # Enable testcases/kernel/power_management's compile and install?m4/ltp-securebits.m4 deleted +0
-10@@ -1,10 +0,0 @@ -dnl SPDX-License-Identifier: GPL-2.0-or-later -dnl Copyright (c) Serge Hallyn (2010) - -AC_DEFUN([LTP_CHECK_SECUREBITS],[ - AC_CHECK_HEADERS(linux/securebits.h,[have_securebits=yes]) -if test "x$have_securebits" != xyes; then - have_securebits=no -fi -AC_SUBST(HAVE_SECUREBITS,$have_securebits) -])testcases/kernel/security/Makefile +0
-4@@ -24,10 +24,6 @@ top_srcdir ?= ../../.. include $(top_srcdir)/include/mk/env_pre.mk -ifneq ($(HAVE_SECUREBITS),yes) -FILTER_OUT_DIRS += securebits -endif - OPT_CFLAGS += -O DEBUG_LDFLAGS += -s
PATCH v2 1/2 m4: remove some useless m4
Since commit fe9d9218c, we have detected linux/securebits.h in confiure.ac. one place used the HAVE_SECUREBITS defined), it only controls compile. kernel/security/securebits/check_keepcaps.c has HAVE_LINUX_SECUREBITS_H check in internal, so removing it is safe.
No testcase used these macros defined in ltp/time.m4, and these (CLOCK_MONOTONIC_RAW, CLOCK_REALTIME_COARSE, CLOCK_MONOTONIC_COARSE) have been defined in lapi/posix_clocks.h. Removing it is safe.
FS_IOC_GETFLAGS and FS_IOC_SETFLAGS have been defined in lapi/fs.h. setxattr03.c checked this ioctl return value, so removing it is safe.
Since commit ef772539, LTP_CHECK_CGROUPSTATS has been removed. But testcase still used it. It looks like a mistakenly deletion. Removing ltp-cgroupstats.m4, check linux/cgroupstats.h in configure.ac.
--- configure.ac | 6 ++-- include/mk/features.mk.default | 3 -- include/mk/features.mk.in | 3 -- m4/ltp-cgroupstats.m4 | 8 ----- m4/ltp-fs_ioc_flags.m4 | 11 ------- m4/ltp-securebits.m4 | 10 ------ m4/ltp-time.m4 | 12 ------- testcases/kernel/security/Makefile | 4 --- .../kernel/syscalls/setxattr/setxattr03.c | 33 +++---------------- 9 files changed, 7 insertions(+), 83 deletions(-) delete mode 100644 m4/ltp-cgroupstats.m4 delete mode 100644 m4/ltp-fs_ioc_flags.m4 delete mode 100644 m4/ltp-securebits.m4 delete mode 100644 m4/ltp-time.m4
configure.ac +2 -4
@@ -36,8 +36,9 @@ AC_CHECK_HEADERS([ \ ifaddrs.h \ keyutils.h \ linux/can.h \ - linux/dccp.h \ + linux/cgroupstats.h \ linux/cryptouser.h \ + linux/dccp.h \ linux/genetlink.h \ linux/keyctl.h \ linux/if_alg.h \
@@ -209,7 +210,6 @@ LTP_CHECK_CLONE_SUPPORTS_7_ARGS LTP_CHECK_CRYPTO LTP_CHECK_FIDEDUPE LTP_CHECK_FORTIFY_SOURCE -LTP_CHECK_FS_IOC_FLAGS LTP_CHECK_FTS_H LTP_CHECK_IF_LINK LTP_CHECK_IOVEC
@@ -226,7 +226,6 @@ LTP_CHECK_NOMMU_LINUX LTP_CHECK_PERF_EVENT LTP_CHECK_PRCTL_SUPPORT LTP_CHECK_RLIMIT64 -LTP_CHECK_SECUREBITS LTP_CHECK_SELINUX LTP_CHECK_SIGNAL LTP_CHECK_STATX
@@ -249,7 +248,6 @@ LTP_CHECK_SYSCALL_QUOTACTL LTP_CHECK_SYSCALL_SIGNALFD LTP_CHECK_SYSCALL_UTIMENSAT LTP_CHECK_TASKSTATS -LTP_CHECK_TIME LTP_CHECK_TIMERFD test "x$with_tirpc" = xyes && LTP_CHECK_TIRPC LTP_CHECK_TPACKET_V3
include/mk/features.mk.default +0 -3
@@ -29,9 +29,6 @@ WITH_PYTHON := no # Features knobs -# Is securebits[.h], et all support available? -HAVE_SECUREBITS := no - # Test suite knobs # Enable testcases/kernel/power_management's compile and install?
include/mk/features.mk.in +0 -3
@@ -29,9 +29,6 @@ WITH_PYTHON := @WITH_PYTHON@ # Features knobs -# Is securebits[.h], et all support available? -HAVE_SECUREBITS := @HAVE_SECUREBITS@ - # Test suite knobs # Enable testcases/kernel/power_management's compile and install?
m4/ltp-cgroupstats.m4 deleted +0 -8
@@ -1,8 +0,0 @@ -dnl SPDX-License-Identifier: GPL-2.0-or-later -dnl Copyright (c) Linux Test Project, 2009 - -AC_DEFUN([LTP_CHECK_CGROUPSTATS], -[ -AC_CHECK_HEADERS(linux/cgroupstats.h,[LTP_CHECK_CGROUPSTATS_HEADER=yes]) -AC_SUBST(LTP_CHECK_CGROUPSTATS_HEADER) -])
m4/ltp-fs_ioc_flags.m4 deleted +0 -11
@@ -1,11 +0,0 @@ -dnl SPDX-License-Identifier: GPL-2.0-or-later -dnl Copyright (c) Linux Test Project, 2012 -dnl Author: Cyril Hrubis <[email protected]> - -AC_DEFUN([LTP_CHECK_FS_IOC_FLAGS],[ -AH_TEMPLATE(HAVE_FS_IOC_FLAGS, -[Define to 1 if you have FS_IOC_GETFLAGS and FS_IOC_SETFLAGS in <linux/fs.h>.]) -AC_MSG_CHECKING([for FS_IOC_GETFLAGS and FS_IOC_SETFLAGS in <linux/fs.h>]) -AC_TRY_COMPILE([#include <linux/fs.h>], [int flags = FS_IOC_GETFLAGS;], - AC_DEFINE(HAVE_FS_IOC_FLAGS) AC_MSG_RESULT(yes), AC_MSG_RESULT(no)) -])
m4/ltp-securebits.m4 deleted +0 -10
@@ -1,10 +0,0 @@ -dnl SPDX-License-Identifier: GPL-2.0-or-later -dnl Copyright (c) Serge Hallyn (2010) - -AC_DEFUN([LTP_CHECK_SECUREBITS],[ - AC_CHECK_HEADERS(linux/securebits.h,[have_securebits=yes]) -if test "x$have_securebits" != xyes; then - have_securebits=no -fi -AC_SUBST(HAVE_SECUREBITS,$have_securebits) -])
m4/ltp-time.m4 deleted +0 -12
@@ -1,12 +0,0 @@ -dnl SPDX-License-Identifier: GPL-2.0-or-later -dnl Author: Ngie Cooper <[email protected]> - -dnl For all directly related time syscalls -AC_DEFUN([LTP_CHECK_TIME],[ - AC_CHECK_DECLS([CLOCK_MONOTONIC_RAW, CLOCK_REALTIME_COARSE, CLOCK_MONOTONIC_COARSE],,,[ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE -#endif -#include <time.h> -]) -])
testcases/kernel/security/Makefile +0 -4
@@ -24,10 +24,6 @@ top_srcdir ?= ../../.. include $(top_srcdir)/include/mk/env_pre.mk -ifneq ($(HAVE_SECUREBITS),yes) -FILTER_OUT_DIRS += securebits -endif - OPT_CFLAGS += -O DEBUG_LDFLAGS += -s
testcases/kernel/syscalls/setxattr/setxattr03.c +5 -28
@@ -1,30 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (C) 2012 Red Hat, Inc. * -* This program is free software; you can redistribute it and/or -* modify it under the terms of version 2 of the GNU General Public -* License as published by the Free Software Foundation. -* -* This program is distributed in the hope that it would be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -* -* Further, this software is distributed without any warranty that it -* is free of the rightful claim of any third person regarding -* infringement or the like. Any license provided herein, whether -* implied or otherwise, applies only to this software file. Patent -* licenses, if any, provided herein do not apply to combinations of -* this program with other software, or any other product whatsoever. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write the Free Software -* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -* 02110-1301, USA. -*/ - -/* * setxattr(2) to immutable and append-only files should get EPERM -* * There are 2 test cases: * 1. Set attribute to a immutable file, setxattr(2) should return -1 * and set errno to EPERM
@@ -47,14 +25,14 @@#ifdef HAVE_SYS_XATTR_H # include <sys/xattr.h> #endif -#include <linux/fs.h> +#include "lapi/fs.h" #include "test.h" #include "safe_macros.h" char *TCID ="setxattr03" ; -#if definedHAVE_SYS_XATTR_H && definedHAVE_FS_IOC_FLAGS +#if definedHAVE_SYS_XATTR_H #define XATTR_TEST_KEY "user.testkey"#define XATTR_TEST_VALUE "this is a test value"#define XATTR_TEST_VALUE_SIZE (sizeof(XATTR_TEST_VALUE) - 1)
@@ -206,7 +184,6 @@ static void cleanup(void)#else int main (void ) { -tst_brkm (TCONF ,NULL ,"<sys/xattr.h> not present or FS_IOC_FLAGS " -"missing in <linux/fs.h>" ); +tst_brkm (TCONF ,NULL ,"<sys/xattr.h> not present" ); } -#endif /* defined HAVE_SYS_XATTR_H && defined HAVE_FS_IOC_FLAGS */ +#endif /* defined HAVE_SYS_XATTR_H */
Signature · 1 line
2.18.1
PATCH v2 2/2 ltp-cap.m4: uncouple licap and cap_compare
Currently, HAVE_LIBCAP is not defined unless libcap supports cap_compare(). The check for libcap and cap_compare() has to be uncoupled because libcap-1 doesn't have cap_compare.
--- m4/ltp-cap.m4 | 21 ++++++++++--------- .../security/filecaps/check_simple_capset.c | 4 ++-- .../security/filecaps/verify_caps_exec.c | 6 +++--- 3 files changed, 16 insertions(+), 15 deletions(-)
m4/ltp-cap.m4 +11 -10
@@ -1,17 +1,18 @@ dnl SPDX-License-Identifier: GPL-2.0-or-later dnl Copyright (c) Cisco Systems Inc., 2009 dnl Copyright (c) Linux Test Project, 2010 +dnl Copyright (c) 2019 FUJITSU LIMITED. All rights reserved. dnl Author: Ngie Cooper <[email protected]> AC_DEFUN([LTP_CHECK_CAPABILITY_SUPPORT],[ -AH_TEMPLATE(HAVE_LIBCAP, -[Define to 1 if you have libcap-2 installed.]) -AC_CHECK_HEADERS([sys/capability.h],[capability_header_prefix="sys"]) -if test "x$capability_header_prefix" != x; then - AC_CHECK_LIB(cap,cap_compare,[cap_libs="-lcap"]) -fi -if test "x$cap_libs" != x; then - AC_DEFINE(HAVE_LIBCAP) -fi -AC_SUBST(CAP_LIBS,$cap_libs) + AC_CHECK_LIB(cap,cap_init,[have_libcap=yes]) + AC_CHECK_LIB(cap,cap_compare,[have_libcap_2=yes]) + AC_CHECK_HEADERS(sys/capability.h,[have_sys_cap=yes]) + if test "x$have_libcap" = "xyes" -a "x$have_sys_cap" = "xyes"; then + AC_DEFINE(HAVE_LIBCAP, 1, [Define to 1 if you have libcap and it's headers installed]) + AC_SUBST(CAP_LIBS, "-lcap") + fi + if test "x$have_libcap_2" = "xyes" -a "x$have_sys_cap" = "xyes"; then + AC_DEFINE(HAVE_LIBCAP_V2, 1, [Define to 1 if you have libcap-2 and it's headers installed]) + fi ])
testcases/kernel/security/filecaps/check_simple_capset.c +2 -2
@@ -27,7 +27,7 @@int main (void ) { -#ifdef HAVE_LIBCAP +#ifdef HAVE_LIBCAP_V2 cap_t caps, caps2;int ret;
@@ -41,7 +41,7 @@ int main(void)cap_free (caps2);return ret;#else -printf ("System doesn't support full POSIX capabilities.\n" ); +printf ("System doesn't support V2 POSIX capabilities.\n" );return 1 ;#endif }
testcases/kernel/security/filecaps/verify_caps_exec.c +3 -3
@@ -62,7 +62,7 @@ static void usage(const char *me)#define DROP_PERMS 0#define KEEP_PERMS 1 -#ifdef HAVE_LIBCAP +#ifdef HAVE_LIBCAP_V2 static void print_my_caps (void ) {cap_t cap =cap_get_proc ();
@@ -398,7 +398,7 @@ static int caps_actually_set_test(void)int main (int argc,char *argv[]) { -#ifdef HAVE_LIBCAP +#ifdef HAVE_LIBCAP_V2 if (argc <2 )usage (argv[0 ]);
@@ -419,7 +419,7 @@ int main(int argc, char *argv[]) usage(argv[0]); }#else -tst_resm (TCONF ,"System doesn't have POSIX capabilities support." ); +tst_resm (TCONF ,"System doesn't have POSIX V2 capabilities support." );#endif tst_exit ();
Signature · 1 line
2.18.1
PATCH v2 1/2 m4: remove some useless m4
In reply to Yang XuHi,
Quoted 9 lines
Since commit
fe9d9218c, we have detectedlinux/securebits.hin confiure.ac. one place used theHAVE_SECUREBITSdefined), it only controls compile.kernel/security/securebits/check_keepcaps.chasHAVE_LINUX_SECUREBITS_Hcheck in internal, so removing it is safe.No testcase used these macros defined in ltp/time.m4, and these (
CLOCK_MONOTONIC_RAW,CLOCK_REALTIME_COARSE,CLOCK_MONOTONIC_COARSE) have been defined inlapi/posix_clocks.h. Removing it is safe.
Quoted 8 lines
FS_IOC_GETFLAGSandFS_IOC_SETFLAGShave been defined inlapi/fs.h.setxattr03.cchecked this ioctl return value, so removing it is safe.Since commit
ef772539,LTP_CHECK_CGROUPSTATShas been removed. But testcase still used it. It looks like a mistakenly deletion. Removing ltp-cgroupstats.m4, checklinux/cgroupstats.hin configure.ac.Signed-off-by Yang Xu <[email protected]>
Although I wonder whether mixing 4 changes (even related to autoconf) in single commit is a good idea (makes it a bit hard to review).
Kind regards,
Petr
PATCH v2 1/2 m4: remove some useless m4
Hi!
Quoted 5 lines
Quoted 1 line
Signed-off-by Yang Xu <[email protected]>Acked-by Petr Vorel <[email protected]>Although I wonder whether mixing 4 changes (even related to autoconf) in single commit is a good idea (makes it a bit hard to review).
Yes please, at least the SPDX conversion has to be in a separate patch.
Signature · 2 lines
Cyril Hrubis [email protected]
PATCH v2 1/2 m4: remove some useless m4
Hi,
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
Signed-off-by Yang Xu <[email protected]>Acked-by Petr Vorel <[email protected]>Although I wonder whether mixing 4 changes (even related to autoconf) in single commit is a good idea (makes it a bit hard to review).
Yes please, at least the SPDX conversion has to be in a separate patch.
+1
BTW m4/ltp-signalfd.m4 would require cleanup as well.
Kind regards,
Petr
PATCH v2 1/2 m4: remove some useless m4
Quoted 11 lines
Hi,
Quoted 5 lines
Quoted 4 lines
Quoted 1 line
Signed-off-by Yang Xu<[email protected]>Acked-by Petr Vorel<[email protected]>Although I wonder whether mixing 4 changes (even related to autoconf) in single commit is a good idea (makes it a bit hard to review).
Yes please, at least the SPDX conversion has to be in a separate patch.
+1
BTW m4/ltp-signalfd.m4 would require cleanup as well.
Hi Cyril ,Petr
Sorry. This patch looks a little mess.
I will split it into five patches, as below:
v3-0001-m4-remove-useless-ltp-securebits.m4.patch v3-0002-m4-remove-useless-ltp-time.m4.patch v3-0003-m4-remove-useless-ltp-fs_ioc_flags.m4.patch V3-0004-m4-remove-useless-ltp-cgroupstats.m4.patch v3-0005-m4-clean-up-ltp-signalfd.m4.patch
Also, SPDX conversion for setxattr03.c, I will cleanup this case after this patchset merged.
Thanks
Yang Xu
Quoted 6 lines
Kind regards,
Petr.
PATCH v3 1/5 m4: remove useless ltp-securebits.m4
In reply to Petr VorelSince commit fe9d9218c, we have detected linux/securebits.h in confiure.ac. one place used the HAVE_SECUREBITS(ltp-securebits.m4 defined), it only controls compile. kernel/security/securebits/ check_keepcaps.c has HAVE_LINUX_SECUREBITS_H check in internal, so removing it is safe.
--- configure.ac | 1 - include/mk/features.mk.default | 3 --- include/mk/features.mk.in | 3 --- m4/ltp-securebits.m4 | 10 ---------- testcases/kernel/security/Makefile | 4 ---- 5 files changed, 21 deletions(-) delete mode 100644 m4/ltp-securebits.m4
configure.ac +0 -1
@@ -231,7 +231,6 @@ LTP_CHECK_NOMMU_LINUX LTP_CHECK_PERF_EVENT LTP_CHECK_PRCTL_SUPPORT LTP_CHECK_RLIMIT64 -LTP_CHECK_SECUREBITS LTP_CHECK_SELINUX LTP_CHECK_SIGNAL LTP_CHECK_STATX
include/mk/features.mk.default +0 -3
@@ -29,9 +29,6 @@ WITH_PYTHON := no # Features knobs -# Is securebits[.h], et all support available? -HAVE_SECUREBITS := no - # Test suite knobs # Enable testcases/kernel/power_management's compile and install?
include/mk/features.mk.in +0 -3
@@ -29,9 +29,6 @@ WITH_PYTHON := @WITH_PYTHON@ # Features knobs -# Is securebits[.h], et all support available? -HAVE_SECUREBITS := @HAVE_SECUREBITS@ - # Test suite knobs # Enable testcases/kernel/power_management's compile and install?
m4/ltp-securebits.m4 deleted +0 -10
@@ -1,10 +0,0 @@ -dnl SPDX-License-Identifier: GPL-2.0-or-later -dnl Copyright (c) Serge Hallyn (2010) - -AC_DEFUN([LTP_CHECK_SECUREBITS],[ - AC_CHECK_HEADERS(linux/securebits.h,[have_securebits=yes]) -if test "x$have_securebits" != xyes; then - have_securebits=no -fi -AC_SUBST(HAVE_SECUREBITS,$have_securebits) -])
testcases/kernel/security/Makefile +0 -4
@@ -24,10 +24,6 @@ top_srcdir ?= ../../.. include $(top_srcdir)/include/mk/env_pre.mk -ifneq ($(HAVE_SECUREBITS),yes) -FILTER_OUT_DIRS += securebits -endif - OPT_CFLAGS += -O DEBUG_LDFLAGS += -s
Signature · 1 line
2.18.1
PATCH v3 2/5 m4: remove useless ltp-time.m4
No testcase used these macros defined in ltp-time.m4, and these (CLOCK_MONOTONIC_RAW, CLOCK_REALTIME_COARSE, CLOCK_MONOTONIC_COARSE) have been defined in lapi/posix_clocks.h. Removing it is safe.
--- configure.ac | 1 - m4/ltp-time.m4 | 12 ------------ 2 files changed, 13 deletions(-) delete mode 100644 m4/ltp-time.m4
configure.ac +0 -1
@@ -253,7 +253,6 @@ LTP_CHECK_SYSCALL_QUOTACTL LTP_CHECK_SYSCALL_SIGNALFD LTP_CHECK_SYSCALL_UTIMENSAT LTP_CHECK_TASKSTATS -LTP_CHECK_TIME LTP_CHECK_TIMERFD test "x$with_tirpc" = xyes && LTP_CHECK_TIRPC LTP_CHECK_TPACKET_V3
m4/ltp-time.m4 deleted +0 -12
@@ -1,12 +0,0 @@ -dnl SPDX-License-Identifier: GPL-2.0-or-later -dnl Author: Ngie Cooper <[email protected]> - -dnl For all directly related time syscalls -AC_DEFUN([LTP_CHECK_TIME],[ - AC_CHECK_DECLS([CLOCK_MONOTONIC_RAW, CLOCK_REALTIME_COARSE, CLOCK_MONOTONIC_COARSE],,,[ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE -#endif -#include <time.h> -]) -])
Signature · 1 line
2.18.1
PATCH v3 3/5 m4:remove useless ltp-fs_ioc_flags.m4
In reply to Yang XuFS_IOC_GETFLAGS and FS_IOC_SETFLAGS have been defined in lapi/fs.h. setxattr03.c checked this ioctl return value, so removing it is safe.
--- configure.ac | 1 - m4/ltp-fs_ioc_flags.m4 | 11 ----------- testcases/kernel/syscalls/setxattr/setxattr03.c | 9 ++++----- 3 files changed, 4 insertions(+), 17 deletions(-) delete mode 100644 m4/ltp-fs_ioc_flags.m4
configure.ac +0 -1
@@ -214,7 +214,6 @@ LTP_CHECK_CLONE_SUPPORTS_7_ARGS LTP_CHECK_CRYPTO LTP_CHECK_FIDEDUPE LTP_CHECK_FORTIFY_SOURCE -LTP_CHECK_FS_IOC_FLAGS LTP_CHECK_FTS_H LTP_CHECK_IF_LINK LTP_CHECK_IOVEC
m4/ltp-fs_ioc_flags.m4 deleted +0 -11
@@ -1,11 +0,0 @@ -dnl SPDX-License-Identifier: GPL-2.0-or-later -dnl Copyright (c) Linux Test Project, 2012 -dnl Author: Cyril Hrubis <[email protected]> - -AC_DEFUN([LTP_CHECK_FS_IOC_FLAGS],[ -AH_TEMPLATE(HAVE_FS_IOC_FLAGS, -[Define to 1 if you have FS_IOC_GETFLAGS and FS_IOC_SETFLAGS in <linux/fs.h>.]) -AC_MSG_CHECKING([for FS_IOC_GETFLAGS and FS_IOC_SETFLAGS in <linux/fs.h>]) -AC_TRY_COMPILE([#include <linux/fs.h>], [int flags = FS_IOC_GETFLAGS;], - AC_DEFINE(HAVE_FS_IOC_FLAGS) AC_MSG_RESULT(yes), AC_MSG_RESULT(no)) -])
testcases/kernel/syscalls/setxattr/setxattr03.c +4 -5
@@ -47,14 +47,14 @@#ifdef HAVE_SYS_XATTR_H # include <sys/xattr.h> #endif -#include <linux/fs.h> +#include "lapi/fs.h" #include "test.h" #include "safe_macros.h" char *TCID ="setxattr03" ; -#if definedHAVE_SYS_XATTR_H && definedHAVE_FS_IOC_FLAGS +#if definedHAVE_SYS_XATTR_H #define XATTR_TEST_KEY "user.testkey"#define XATTR_TEST_VALUE "this is a test value"#define XATTR_TEST_VALUE_SIZE (sizeof(XATTR_TEST_VALUE) - 1)
@@ -206,7 +206,6 @@ static void cleanup(void)#else int main (void ) { -tst_brkm (TCONF ,NULL ,"<sys/xattr.h> not present or FS_IOC_FLAGS " -"missing in <linux/fs.h>" ); +tst_brkm (TCONF ,NULL ,"<sys/xattr.h> not present" ); } -#endif /* defined HAVE_SYS_XATTR_H && defined HAVE_FS_IOC_FLAGS */ +#endif /* defined HAVE_SYS_XATTR_H */
Signature · 1 line
2.18.1
PATCH v3 4/5 m4: remove useless ltp-cgroupstats.m4
In reply to Yang XuSince commit ef772539, LTP_CHECK_CGROUPSTATS has been removed. But testcase still used it. It looks like a mistakenly deletion. Removing ltp-cgroupstats.m4, check linux/cgroupstats.h in configure.ac.
--- configure.ac | 1 + m4/ltp-cgroupstats.m4 | 8 -------- 2 files changed, 1 insertion(+), 8 deletions(-) delete mode 100644 m4/ltp-cgroupstats.m4
configure.ac +1 -0
@@ -38,6 +38,7 @@ AC_CHECK_HEADERS([ \ linux/can.h \ linux/dccp.h \ linux/cryptouser.h \ + linux/cgroupstats.h \ linux/genetlink.h \ linux/keyctl.h \ linux/if_alg.h \
m4/ltp-cgroupstats.m4 deleted +0 -8
@@ -1,8 +0,0 @@ -dnl SPDX-License-Identifier: GPL-2.0-or-later -dnl Copyright (c) Linux Test Project, 2009 - -AC_DEFUN([LTP_CHECK_CGROUPSTATS], -[ -AC_CHECK_HEADERS(linux/cgroupstats.h,[LTP_CHECK_CGROUPSTATS_HEADER=yes]) -AC_SUBST(LTP_CHECK_CGROUPSTATS_HEADER) -])
Signature · 1 line
2.18.1
PATCH v3 5/5 m4: clean up ltp-signalfd.m4
In reply to Yang XuSince patch[1] in 2007.10, the signo had been rename as ssi_signo. The code is so old we can remove signo detection.
Also since patch[2] in 2009.1, the linux/type.h had been include. we can remove this detection.
I don't find "signalfd.h" in /usr/include on different distros, so I think we can only use two ways(glibc or tst_syscall) to call it.
[1]:https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=96358de6 [2]:https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a788fd53
--- m4/ltp-signalfd.m4 | 62 +++---------------- .../kernel/syscalls/signalfd/signalfd01.c | 22 ++----- 2 files changed, 13 insertions(+), 71 deletions(-)
m4/ltp-signalfd.m4 +7 -55
@@ -1,65 +1,17 @@ dnl SPDX-License-Identifier: GPL-2.0-or-later dnl Copyright (c) Red Hat Inc., 2008 +dnl Copyright (c) 2019 Fujitsu Ltd. dnl Author: Masatake YAMATO <[email protected]> -dnl LTP_CHECK_SYSCALL_SIGNALFD -dnl -------------------------- -dnl * Checking the existence of the libc wrapper for signalfd. -dnl If it exists, a shell variable LTP_SYSCALL_SIGNALFD_FUNCTION is set to "yes". -dnl -dnl * Checking the existence of signalfd.h. -dnl If it exists, a shell variable LTP_SYSCALL_SIGNALFD_HEADER is set to "yes". -dnl -dnl * Checking the prefix used in fileds for signalfd_siginfo structure. -dnl If it exists, a shell variable LTP_SYSCALL_SIGNALFD_FIELD_PREFIX is set to "given". -dnl -dnl About cpp macros defined in this macro, -dnl see testcases/kernel/syscalls/signalfd/signalfd01.c of ltp. -AC_DEFUN([LTP_CHECK_SYSCALL_SIGNALFD], -[ -_LTP_CHECK_SYSCALL_SIGNALFD_FUNCTION -_LTP_CHECK_SYSCALL_SIGNALFD_HEADER +AC_DEFUN([LTP_CHECK_SYSCALL_SIGNALFD],[ -if test x"$LTP_SYSCALL_SIGNALFD_HEADER" = xyes; then - _LTP_CHECK_SYSCALL_SIGNALFD_FIELD_PREFIX -fi] -) - -dnl _LTP_CHECK_SYSCALL_SIGNALFD_FUNCTION -dnl ------------------------------------ -AC_DEFUN([_LTP_CHECK_SYSCALL_SIGNALFD_FUNCTION],[ -AC_CHECK_FUNCS(signalfd,[LTP_SYSCALL_SIGNALFD_FUNCTION=yes])]) - -dnl _LTP_CHECK_SYSCALL_SIGNALFD_HEADER -dnl ---------------------------------- -AC_DEFUN([_LTP_CHECK_SYSCALL_SIGNALFD_HEADER], -[ -AC_CHECK_HEADERS([sys/signalfd.h linux/types.h]) -AC_CHECK_HEADERS([linux/signalfd.h signalfd.h],[ -LTP_SYSCALL_SIGNALFD_HEADER=yes],,[ -#ifdef HAVE_LINUX_TYPES_H -#include <linux/types.h> -#endif -] -) -] -) - -dnl _LTP_CHECK_SYSCALL_SIGNALFD_FIELD_PREFIX -dnl ---------------------------------------- -AC_DEFUN([_LTP_CHECK_SYSCALL_SIGNALFD_FIELD_PREFIX], -[ -AC_CHECK_MEMBERS([struct signalfd_siginfo.ssi_signo, struct signalfd_siginfo.signo],[ -LTP_SYSCALL_SIGNALFD_FIELD_PREFIX=given],,[ +AC_CHECK_FUNCS(signalfd,,) +AC_CHECK_HEADERS([sys/signalfd.h],,) +AC_CHECK_HEADERS([linux/signalfd.h],,) +AC_CHECK_MEMBERS([struct signalfd_siginfo.ssi_signo],,,[ #if defined HAVE_SYS_SIGNALFD_H #include <sys/signalfd.h> #elif defined HAVE_LINUX_SIGNALFD_H -#ifdef HAVE_LINUX_TYPES_H -#include <linux/types.h> -#endif #include <linux/signalfd.h> -#elif defined HAVE_SIGNALFD_H -#include <signalfd.h> #endif]) -] -) +])
testcases/kernel/syscalls/signalfd/signalfd01.c +6 -16
@@ -56,22 +56,13 @@ int TST_TOTAL = 1;#if definedHAVE_SYS_SIGNALFD_H #include <sys/signalfd.h> #elif definedHAVE_LINUX_SIGNALFD_H -#if definedHAVE_LINUX_TYPES_H -#include <linux/types.h> -#endif #include <linux/signalfd.h> #define USE_OWNIMPL -#elif definedHAVE_SIGNALFD_H -#include <signalfd.h> #else #define USE_STUB #endif -#if definedHAVE_STRUCT_SIGNALFD_SIGINFO_SSI_SIGNO -#define SIGNALFD_PREFIX (FIELD ) ssi_##FIELD -#elif definedHAVE_STRUCT_SIGNALFD_SIGINFO_SIGNO -#define SIGNALFD_PREFIX (FIELD ) FIELD -#else +#ifndef HAVE_STRUCT_SIGNALFD_SIGINFO_SSI_SIGNO #define USE_STUB #endif
@@ -170,14 +161,13 @@ int do_test1(uint32_t sig) goto out; } -if (fdsi.SIGNALFD_PREFIX (signo) == sig) { +if (fdsi.ssi_signo == sig) {tst_resm (TPASS ,"got expected signal" ); sfd_for_next = sfd; goto out; }else {tst_resm (TFAIL ,"got unexpected signal: signal=%d : %s" , - fdsi.SIGNALFD_PREFIX (signo), -strsignal (fdsi.SIGNALFD_PREFIX (signo))); + fdsi.ssi_signo,strsignal (fdsi.ssi_signo)); sfd_for_next =-1 ;close (sfd); goto out;
@@ -254,13 +244,13 @@ void do_test2(int fd, uint32_t sig) goto out; } -if (fdsi.SIGNALFD_PREFIX (signo) == sig) { +if (fdsi.ssi_signo == sig) {tst_resm (TPASS ,"got expected signal" ); goto out; }else {tst_resm (TFAIL ,"got unexpected signal: signal=%d : %s" , - fdsi.SIGNALFD_PREFIX (signo), -strsignal (fdsi.SIGNALFD_PREFIX (signo))); + fdsi.ssi_signo), +strsignal (fdsi.ssi_signo); goto out; }
Signature · 1 line
2.18.1
PATCH v3 1/5 m4: remove useless ltp-securebits.m4
In reply to Yang XuHi Yang,
Quoted 8 lines
Since commit
fe9d9218c, we have detectedlinux/securebits.hin confiure.ac. one place used theHAVE_SECUREBITS(ltp-securebits.m4 defined), it only controls compile.kernel/security/securebits/check_keepcaps.chasHAVE_LINUX_SECUREBITS_Hcheck in internal, so removing it is safe.Signed-off-by Yang Xu <[email protected]>Reviewed-by Xiao Yang <[email protected]>
Whole patchset merged (with tiny changes in commit messages). Thanks for this cleanup and speedup!
Kind regards,
Petr
PATCH 1/1 m4: remove useless ltp-securebits.m4
In reply to Xiao YangHi Xiao
I have sent a v2 patch about removing more useless m4.
Quoted 88 lines
Hi Xu,
LGTM. :-)
Reviewed-by Xiao Yang <[email protected]>Best Regards,
Xiao Yang
Quoted 77 lines · Yang Xu
Since commit
fe9d9218c, we have detectedlinux/securebits.hin confiure.ac. one place used theHAVE_SECUREBITS(ltp-securebits.m4 defined), it only controls compile.kernel/security/securebits/check_keepcaps.chasHAVE_LINUX_SECUREBITS_Hcheck in internal, so removing it is safe.Signed-off-by Yang Xu <[email protected]>--- configure.ac | 1 - include/mk/features.mk.default | 3 --- include/mk/features.mk.in | 3 --- m4/ltp-securebits.m4 | 10 ---------- testcases/kernel/security/Makefile | 4 ---- 5 files changed, 21 deletions(-)delete mode 100644 m4/ltp-securebits.m4
configure.ac +0
-1@@ -226,7 +226,6 @@ LTP_CHECK_NOMMU_LINUX LTP_CHECK_PERF_EVENT LTP_CHECK_PRCTL_SUPPORT LTP_CHECK_RLIMIT64 -LTP_CHECK_SECUREBITS LTP_CHECK_SELINUX LTP_CHECK_SIGNAL LTP_CHECK_STATXinclude/mk/features.mk.default +0
-2@@ -29,9 +29,6 @@ WITH_PYTHON := no # Features knobs -# Is securebits[.h], et all support available? -HAVE_SECUREBITS := no - # Test suite knobs # Enable testcases/kernel/power_management's compile and install?include/mk/features.mk.in +0
-2@@ -29,9 +29,6 @@ WITH_PYTHON := @WITH_PYTHON@ # Features knobs -# Is securebits[.h], et all support available? -HAVE_SECUREBITS := @HAVE_SECUREBITS@ - # Test suite knobs # Enable testcases/kernel/power_management's compile and install?m4/ltp-securebits.m4 deleted +0
-10@@ -1,10 +0,0 @@ -dnl SPDX-License-Identifier: GPL-2.0-or-later -dnl Copyright (c) Serge Hallyn (2010) - -AC_DEFUN([LTP_CHECK_SECUREBITS],[ - AC_CHECK_HEADERS(linux/securebits.h,[have_securebits=yes]) -if test "x$have_securebits" != xyes; then - have_securebits=no -fi -AC_SUBST(HAVE_SECUREBITS,$have_securebits) -])testcases/kernel/security/Makefile +0
-2@@ -24,10 +24,6 @@ top_srcdir ?= ../../.. include $(top_srcdir)/include/mk/env_pre.mk -ifneq ($(HAVE_SECUREBITS),yes) -FILTER_OUT_DIRS += securebits -endif
Quoted 9 lines
testcases/kernel/security/Makefile top_srcdir ?= ../../.. · line 28
Quoted 3 lines
testcases/kernel/security/Makefile +0
-1- OPT_CFLAGS += -O DEBUG_LDFLAGS += -s.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20190722/e9d70efb/attachment-0001.htm>