[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190625172126.GB6128@tower.DHCP.thefacebook.com>
Date: Tue, 25 Jun 2019 17:21:31 +0000
From: Roman Gushchin <guro@...com>
To: Jakub Kicinski <jakub.kicinski@...ronome.com>
CC: "alexei.starovoitov@...il.com" <alexei.starovoitov@...il.com>,
"daniel@...earbox.net" <daniel@...earbox.net>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"bpf@...r.kernel.org" <bpf@...r.kernel.org>,
"oss-drivers@...ronome.com" <oss-drivers@...ronome.com>,
"sdf@...gle.com" <sdf@...gle.com>,
Quentin Monnet <quentin.monnet@...ronome.com>
Subject: Re: [PATCH bpf] tools: bpftool: use correct argument in cgroup errors
On Tue, Jun 25, 2019 at 09:56:31AM -0700, Jakub Kicinski wrote:
> cgroup code tries to use argv[0] as the cgroup path,
> but if it fails uses argv[1] to report errors.
>
> Fixes: 5ccda64d38cc ("bpftool: implement cgroup bpf operations")
> Signed-off-by: Jakub Kicinski <jakub.kicinski@...ronome.com>
> Reviewed-by: Quentin Monnet <quentin.monnet@...ronome.com>
Acked-by: Roman Gushchin <guro@...com>
Thanks, Jakub!
> ---
> tools/bpf/bpftool/cgroup.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/tools/bpf/bpftool/cgroup.c b/tools/bpf/bpftool/cgroup.c
> index 73ec8ea33fb4..a13fb7265d1a 100644
> --- a/tools/bpf/bpftool/cgroup.c
> +++ b/tools/bpf/bpftool/cgroup.c
> @@ -168,7 +168,7 @@ static int do_show(int argc, char **argv)
>
> cgroup_fd = open(argv[0], O_RDONLY);
> if (cgroup_fd < 0) {
> - p_err("can't open cgroup %s", argv[1]);
> + p_err("can't open cgroup %s", argv[0]);
> goto exit;
> }
>
> @@ -356,7 +356,7 @@ static int do_attach(int argc, char **argv)
>
> cgroup_fd = open(argv[0], O_RDONLY);
> if (cgroup_fd < 0) {
> - p_err("can't open cgroup %s", argv[1]);
> + p_err("can't open cgroup %s", argv[0]);
> goto exit;
> }
>
> @@ -414,7 +414,7 @@ static int do_detach(int argc, char **argv)
>
> cgroup_fd = open(argv[0], O_RDONLY);
> if (cgroup_fd < 0) {
> - p_err("can't open cgroup %s", argv[1]);
> + p_err("can't open cgroup %s", argv[0]);
> goto exit;
> }
>
> --
> 2.21.0
>
Powered by blists - more mailing lists