BPF Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] tools/bpf/bpftool: Fix wrong return value in do_dump()
@ 2020-08-02 11:15 Tianjia Zhang
  2020-08-03  1:16 ` Andrii Nakryiko
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Tianjia Zhang @ 2020-08-02 11:15 UTC (permalink / raw)
  To: ast, daniel, kafai, songliubraving, yhs, andriin, john.fastabend,
	kpsingh, quentin, kuba, toke, tklauser, tianjia.zhang, jolsa
  Cc: netdev, bpf, linux-kernel, tianjia.zhang

In case of btf_id does not exist, a negative error code -ENOENT
should be returned.

Fixes: c93cc69004df3 ("bpftool: add ability to dump BTF types")
Cc: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
---
 tools/bpf/bpftool/btf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/bpf/bpftool/btf.c b/tools/bpf/bpftool/btf.c
index faac8189b285..c2f1fd414820 100644
--- a/tools/bpf/bpftool/btf.c
+++ b/tools/bpf/bpftool/btf.c
@@ -596,7 +596,7 @@ static int do_dump(int argc, char **argv)
 			goto done;
 		}
 		if (!btf) {
-			err = ENOENT;
+			err = -ENOENT;
 			p_err("can't find btf with ID (%u)", btf_id);
 			goto done;
 		}
-- 
2.26.2


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] tools/bpf/bpftool: Fix wrong return value in do_dump()
  2020-08-02 11:15 [PATCH] tools/bpf/bpftool: Fix wrong return value in do_dump() Tianjia Zhang
@ 2020-08-03  1:16 ` Andrii Nakryiko
  2020-08-03  5:04   ` John Fastabend
  2020-08-03  8:41 ` Tobias Klauser
  2020-08-03 14:33 ` Daniel Borkmann
  2 siblings, 1 reply; 5+ messages in thread
From: Andrii Nakryiko @ 2020-08-03  1:16 UTC (permalink / raw)
  To: Tianjia Zhang
  Cc: Alexei Starovoitov, Daniel Borkmann, Martin Lau, Song Liu,
	Yonghong Song, Andrii Nakryiko, john fastabend, KP Singh,
	Quentin Monnet, Jakub Kicinski, Toke Høiland-Jørgensen,
	Tobias Klauser, Jiri Olsa, Networking, bpf, open list,
	tianjia.zhang

On Sun, Aug 2, 2020 at 4:16 AM Tianjia Zhang
<tianjia.zhang@linux.alibaba.com> wrote:
>
> In case of btf_id does not exist, a negative error code -ENOENT
> should be returned.
>
> Fixes: c93cc69004df3 ("bpftool: add ability to dump BTF types")
> Cc: Andrii Nakryiko <andriin@fb.com>
> Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
> ---


Acked-by: Andrii Nakryiko <andriin@fb.com>

>  tools/bpf/bpftool/btf.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/bpf/bpftool/btf.c b/tools/bpf/bpftool/btf.c
> index faac8189b285..c2f1fd414820 100644
> --- a/tools/bpf/bpftool/btf.c
> +++ b/tools/bpf/bpftool/btf.c
> @@ -596,7 +596,7 @@ static int do_dump(int argc, char **argv)
>                         goto done;
>                 }
>                 if (!btf) {
> -                       err = ENOENT;
> +                       err = -ENOENT;
>                         p_err("can't find btf with ID (%u)", btf_id);
>                         goto done;
>                 }
> --
> 2.26.2
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] tools/bpf/bpftool: Fix wrong return value in do_dump()
  2020-08-03  1:16 ` Andrii Nakryiko
@ 2020-08-03  5:04   ` John Fastabend
  0 siblings, 0 replies; 5+ messages in thread
From: John Fastabend @ 2020-08-03  5:04 UTC (permalink / raw)
  To: Andrii Nakryiko, Tianjia Zhang
  Cc: Alexei Starovoitov, Daniel Borkmann, Martin Lau, Song Liu,
	Yonghong Song, Andrii Nakryiko, john fastabend, KP Singh,
	Quentin Monnet, Jakub Kicinski, Toke Høiland-Jørgensen,
	Tobias Klauser, Jiri Olsa, Networking, bpf, open list,
	tianjia.zhang

Andrii Nakryiko wrote:
> On Sun, Aug 2, 2020 at 4:16 AM Tianjia Zhang
> <tianjia.zhang@linux.alibaba.com> wrote:
> >
> > In case of btf_id does not exist, a negative error code -ENOENT
> > should be returned.
> >
> > Fixes: c93cc69004df3 ("bpftool: add ability to dump BTF types")
> > Cc: Andrii Nakryiko <andriin@fb.com>
> > Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
> > ---
> 
> 
> Acked-by: Andrii Nakryiko <andriin@fb.com>
> 

Acked-by: John Fastabend <john.fastabend@gmail.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] tools/bpf/bpftool: Fix wrong return value in do_dump()
  2020-08-02 11:15 [PATCH] tools/bpf/bpftool: Fix wrong return value in do_dump() Tianjia Zhang
  2020-08-03  1:16 ` Andrii Nakryiko
@ 2020-08-03  8:41 ` Tobias Klauser
  2020-08-03 14:33 ` Daniel Borkmann
  2 siblings, 0 replies; 5+ messages in thread
From: Tobias Klauser @ 2020-08-03  8:41 UTC (permalink / raw)
  To: Tianjia Zhang
  Cc: ast, daniel, kafai, songliubraving, yhs, andriin, john.fastabend,
	kpsingh, quentin, kuba, toke, jolsa, netdev, bpf, linux-kernel,
	tianjia.zhang

On 2020-08-02 at 13:15:40 +0200, Tianjia Zhang <tianjia.zhang@linux.alibaba.com> wrote:
> In case of btf_id does not exist, a negative error code -ENOENT
> should be returned.
> 
> Fixes: c93cc69004df3 ("bpftool: add ability to dump BTF types")
> Cc: Andrii Nakryiko <andriin@fb.com>
> Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>

Reviewed-by: Tobias Klauser <tklauser@distanz.ch>

> ---
>  tools/bpf/bpftool/btf.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/bpf/bpftool/btf.c b/tools/bpf/bpftool/btf.c
> index faac8189b285..c2f1fd414820 100644
> --- a/tools/bpf/bpftool/btf.c
> +++ b/tools/bpf/bpftool/btf.c
> @@ -596,7 +596,7 @@ static int do_dump(int argc, char **argv)
>  			goto done;
>  		}
>  		if (!btf) {
> -			err = ENOENT;
> +			err = -ENOENT;
>  			p_err("can't find btf with ID (%u)", btf_id);
>  			goto done;
>  		}
> -- 
> 2.26.2
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] tools/bpf/bpftool: Fix wrong return value in do_dump()
  2020-08-02 11:15 [PATCH] tools/bpf/bpftool: Fix wrong return value in do_dump() Tianjia Zhang
  2020-08-03  1:16 ` Andrii Nakryiko
  2020-08-03  8:41 ` Tobias Klauser
@ 2020-08-03 14:33 ` Daniel Borkmann
  2 siblings, 0 replies; 5+ messages in thread
From: Daniel Borkmann @ 2020-08-03 14:33 UTC (permalink / raw)
  To: Tianjia Zhang, ast, kafai, songliubraving, yhs, andriin,
	john.fastabend, kpsingh, quentin, kuba, toke, tklauser, jolsa
  Cc: netdev, bpf, linux-kernel, tianjia.zhang

On 8/2/20 1:15 PM, Tianjia Zhang wrote:
> In case of btf_id does not exist, a negative error code -ENOENT
> should be returned.
> 
> Fixes: c93cc69004df3 ("bpftool: add ability to dump BTF types")
> Cc: Andrii Nakryiko <andriin@fb.com>
> Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>

Applied, thanks!

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, back to index

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-02 11:15 [PATCH] tools/bpf/bpftool: Fix wrong return value in do_dump() Tianjia Zhang
2020-08-03  1:16 ` Andrii Nakryiko
2020-08-03  5:04   ` John Fastabend
2020-08-03  8:41 ` Tobias Klauser
2020-08-03 14:33 ` Daniel Borkmann

BPF Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/bpf/0 bpf/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 bpf bpf/ https://lore.kernel.org/bpf \
		bpf@vger.kernel.org
	public-inbox-index bpf

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.bpf


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git