[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAKUNZ7F-UofMmbD6VtwSiu2ho1-fQ1yFxnfC57-oN5L9ksi+sg@mail.gmail.com>
Date: Tue, 11 Mar 2025 11:33:49 +0900
From: 남세원 <swnam0729@...il.com>
To: Quentin Monnet <qmo@...nel.org>, Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>, Andrii Nakryiko <andrii@...nel.org>, Song Liu <song@...nel.org>,
Eduard Zingerman <eddyz87@...il.com>, Martin KaFai Lau <martin.lau@...ux.dev>, Jiri Olsa <jolsa@...nel.org>,
Yonghong Song <yonghong.song@...ux.dev>, John Fastabend <john.fastabend@...il.com>,
KP Singh <kpsingh@...nel.org>, Hao Luo <haoluo@...gle.com>,
Stanislav Fomichev <sdf@...ichev.me>
Cc: bpf@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] bpf: bpftool: Setting error code in do_loader()
Ngomhla ka-Mso, Mas 10, 2025 ngo-22:28 Quentin Monnet <qmo@...nel.org> wabhala:
>
> 2025-03-10 14:25 UTC+0900 ~ nswon <swnam0729@...il.com>
> > missing error code in do_loader()
> > bpf_object__open_file() failed, but return 0
> > This means the command's exit status code was successful, so make sure to return the correct error code.
> >
> > Link: https://lore.kernel.org/bpf/d3b5b4b4-19bb-4619-b4dd-86c958c4a367@stanley.mountain/t/#u
> > Closes: https://github.com/libbpf/bpftool/issues/156
> > Signed-off-by: nswon <swnam0729@...il.com>
>
>
> Thanks for this!
>
> Others may correct me if I'm wrong, but I think you should sign off with
> your full name here (although it doesn't strictly have to be a full
> name, the patch submission docs mention in should be a "known identity"
> so I'm not sure whether a GitHub handle, for example, is acceptable).
>
>
> > ---
> > tools/bpf/bpftool/prog.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/tools/bpf/bpftool/prog.c b/tools/bpf/bpftool/prog.c
> > index e71be67f1d86..641802e308f4 100644
> > --- a/tools/bpf/bpftool/prog.c
> > +++ b/tools/bpf/bpftool/prog.c
> > @@ -1928,6 +1928,7 @@ static int do_loader(int argc, char **argv)
> >
> > obj = bpf_object__open_file(file, &open_opts);
> > if (!obj) {
> > + err = libbpf_get_error(obj);
>
>
> This is the correct way to retrieve the error code, but given that
> bpftool does nothing with this error code, could we instead simply
> return -1 to remain consistent with the other locations where we call
> bpf_object__open_file() in the tool, please?
>
> Thanks,
> Quentin
Thanks for the review!
I'll submit a v2 patch soon with the signature renamed :)
Powered by blists - more mailing lists