From: Roman Gushchin <guro@fb.com>
To: Jakub Kicinski <jakub.kicinski@netronome.com>
Cc: "alexei.starovoitov@gmail.com" <alexei.starovoitov@gmail.com>,
"daniel@iogearbox.net" <daniel@iogearbox.net>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"bpf@vger.kernel.org" <bpf@vger.kernel.org>,
"oss-drivers@netronome.com" <oss-drivers@netronome.com>,
"sdf@google.com" <sdf@google.com>,
Quentin Monnet <quentin.monnet@netronome.com>
Subject: Re: [PATCH bpf] tools: bpftool: use correct argument in cgroup errors
Date: Tue, 25 Jun 2019 17:21:31 +0000 [thread overview]
Message-ID: <20190625172126.GB6128@tower.DHCP.thefacebook.com> (raw)
In-Reply-To: <20190625165631.18928-1-jakub.kicinski@netronome.com>
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@netronome.com>
> Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com>
Acked-by: Roman Gushchin <guro@fb.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
>
next prev parent reply other threads:[~2019-06-25 17:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-25 16:56 [PATCH bpf] tools: bpftool: use correct argument in cgroup errors Jakub Kicinski
2019-06-25 17:21 ` Roman Gushchin [this message]
2019-06-26 14:30 ` Daniel Borkmann
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=20190625172126.GB6128@tower.DHCP.thefacebook.com \
--to=guro@fb.com \
--cc=alexei.starovoitov@gmail.com \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=jakub.kicinski@netronome.com \
--cc=netdev@vger.kernel.org \
--cc=oss-drivers@netronome.com \
--cc=quentin.monnet@netronome.com \
--cc=sdf@google.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox