All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Palethorpe <rpalethorpe@suse.de>
To: Petr Vorel <pvorel@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH 1/1] containers: Remove setns_check
Date: Fri, 20 Jan 2023 14:05:53 +0000	[thread overview]
Message-ID: <873585s3lj.fsf@suse.de> (raw)
In-Reply-To: <20230117181657.20932-1-pvorel@suse.cz>


Petr Vorel <pvorel@suse.cz> writes:

> setns_check.c was used to verify __NR_setns support.
> It was added in Linux 3.0 and SYSCALL_DEFINE2(setns, int, fd, int,
> flags) is not guarded by any configuration variable.
>
> => safe to remove the helper.
>
> Signed-off-by: Petr Vorel <pvorel@suse.cz>

Reviewed-by: Richard Palethorpe <rpalethorpe@suse.com>

> ---
>  doc/namespaces-helper-tools.txt               |  2 --
>  .../kernel/containers/netns/netns_lib.sh      |  3 --
>  .../kernel/containers/netns/netns_sysfs.sh    |  5 ---
>  testcases/kernel/containers/share/.gitignore  |  1 -
>  .../kernel/containers/share/setns_check.c     | 32 -------------------
>  5 files changed, 43 deletions(-)
>  delete mode 100644 testcases/kernel/containers/share/setns_check.c
>
> diff --git a/doc/namespaces-helper-tools.txt b/doc/namespaces-helper-tools.txt
> index 6990e0155a..81eec4d6ca 100644
> --- a/doc/namespaces-helper-tools.txt
> +++ b/doc/namespaces-helper-tools.txt
> @@ -14,8 +14,6 @@ located in ltp/testcases/kernel/containers/share directory and include:
>  ** PID of the daemonized child process is printed on the stdout
>  ** the new namespace(s) is(are) maintained by the daemonized child process
>  ** namespace(s) can be removed by killing the daemonized process
> -* setns_check
> -** check for setns() availability, should be called before using ns_exec
>  * ns_exec
>  ** enters the namespace(s) of a process specified by a PID
>  ** then executes the indicated program inside that namespace(s)
> diff --git a/testcases/kernel/containers/netns/netns_lib.sh b/testcases/kernel/containers/netns/netns_lib.sh
> index 79e90336a8..039631e9f6 100755
> --- a/testcases/kernel/containers/netns/netns_lib.sh
> +++ b/testcases/kernel/containers/netns/netns_lib.sh
> @@ -72,9 +72,6 @@ netns_setup()
>  	if [ "$NS_EXEC" = "ip" ]; then
>  		netns_ip_setup
>  	else
> -		setns_check
> -		[ $? -eq 32 ] && tst_brk TCONF "setns not supported"
> -
>  		NS_TYPE="net"
>  		netns_ns_exec_setup
>  	fi
> diff --git a/testcases/kernel/containers/netns/netns_sysfs.sh b/testcases/kernel/containers/netns/netns_sysfs.sh
> index 1792427210..34ef3b8eef 100755
> --- a/testcases/kernel/containers/netns/netns_sysfs.sh
> +++ b/testcases/kernel/containers/netns/netns_sysfs.sh
> @@ -18,11 +18,6 @@ do_setup()
>  	DUMMYDEV_HOST="dummy_test0"
>  	DUMMYDEV="dummy_test1"
>  
> -	setns_check
> -	if [ $? -eq 32 ]; then
> -		tst_brk TCONF "setns not supported"
> -	fi
> -
>  	NS_HANDLE=$(ns_create $NS_TYPE)
>  	if [ $? -eq 1 ]; then
>  		tst_res TINFO "$NS_HANDLE"
> diff --git a/testcases/kernel/containers/share/.gitignore b/testcases/kernel/containers/share/.gitignore
> index 06615d9ea2..0d5ecf069d 100644
> --- a/testcases/kernel/containers/share/.gitignore
> +++ b/testcases/kernel/containers/share/.gitignore
> @@ -1,4 +1,3 @@
>  /ns_ifmove
>  /ns_create
>  /ns_exec
> -/setns_check
> diff --git a/testcases/kernel/containers/share/setns_check.c b/testcases/kernel/containers/share/setns_check.c
> deleted file mode 100644
> index 75aad17f3a..0000000000
> --- a/testcases/kernel/containers/share/setns_check.c
> +++ /dev/null
> @@ -1,32 +0,0 @@
> -/* Copyright (c) 2015 Fujitsu Ltd.
> - * Author: Guangwen Feng <fenggw-fnst@cn.fujitsu.com>
> - *
> - * This program is free software: you can redistribute it and/or modify
> - * it under the terms of version 2 the GNU General Public License as
> - * published by the Free Software Foundation.
> - *
> - * This program is distributed in the hope that it will be useful,
> - * but WITHOUT ANY WARRANTY; without even the implied warranty of
> - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> - * GNU General Public License for more details.
> - *
> - * You should have received a copy of the GNU General Public License
> - * along with this program.  If not, see <http://www.gnu.org/licenses/>.
> - *
> - ***********************************************************************
> - * Check for setns() availability, should be called before ns_exec.
> - *
> - */
> -
> -#include "test.h"
> -#include "lapi/syscalls.h"
> -
> -char *TCID = "setns_check";
> -
> -int main(void)
> -{
> -	if (syscall(__NR_setns, -1, 0) == -1 && errno == ENOSYS)
> -		tst_brkm(TCONF, NULL, "setns is not supported in the kernel");
> -	else
> -		return 0;
> -}
> -- 
> 2.39.0


-- 
Thank you,
Richard.

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2023-01-20 14:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-17 18:16 [LTP] [PATCH 1/1] containers: Remove setns_check Petr Vorel
2023-01-20 14:05 ` Richard Palethorpe [this message]
2023-01-24 21:05   ` Petr Vorel
2023-01-27 19:27     ` Petr Vorel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=873585s3lj.fsf@suse.de \
    --to=rpalethorpe@suse.de \
    --cc=ltp@lists.linux.it \
    --cc=pvorel@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.