Thread (6 messages) flat view 6 messages, 4 authors, 2019-08-09

Re: [PATCH bpf 2/2] tools: bpftool: add error message on pin failure

From: Andrii Nakryiko <hidden>
Date: 2019-08-08 18:54:25
Also in: bpf

On Tue, Aug 6, 2019 at 5:21 PM Jakub Kicinski
[off-list ref] wrote:
No error message is currently printed if the pin syscall
itself fails. It got lost in the loadall refactoring.

Fixes: 77380998d91d ("bpftool: add loadall command")
Reported-by: Andy Lutomirski <luto@kernel.org>
Signed-off-by: Jakub Kicinski <redacted>
Reviewed-by: Quentin Monnet <redacted>
---
Acked-by: Andrii Nakryiko <redacted>
quoted hunk ↗ jump to hunk
CC: luto@kernel.org, sdf@google.com

 tools/bpf/bpftool/common.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/tools/bpf/bpftool/common.c b/tools/bpf/bpftool/common.c
index c52a6ffb8949..6a71324be628 100644
--- a/tools/bpf/bpftool/common.c
+++ b/tools/bpf/bpftool/common.c
@@ -204,7 +204,11 @@ int do_pin_fd(int fd, const char *name)
        if (err)
                return err;

-       return bpf_obj_pin(fd, name);
+       err = bpf_obj_pin(fd, name);
+       if (err)
+               p_err("can't pin the object (%s): %s", name, strerror(errno));
+
+       return err;
 }

 int do_pin_any(int argc, char **argv, int (*get_fd_by_id)(__u32))
--
2.21.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help