Skip to contentSkip to conversation

libbpf: Return -ENODATA for missing btf section

PATCH Applied Changbin Du 2 participants 2 messages Dec 31, 2022 – Jan 3, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libbpf: Return -ENODATA for missing btf section

As discussed before, return -ENODATA (No data available) would be more meaningful than ENOENT (No such file or directory).

---
 tools/lib/bpf/btf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/lib/bpf/btf.c +1 -1
index dd2badf1a54e..2c89454c0136 100644
@@ -991,7 +991,7 @@ static struct btf *btf_parse_elf(const char *path, struct btf *base_btf,
 
 	if (!btf_data) {
 		pr_warn("failed to find '%s' ELF section in %s\n", BTF_ELF_SEC, path);
-		err = -ENOENT;
+		err = -ENODATA;
 		goto done;
 	}
 	btf = btf_new(btf_data->d_buf, btf_data->d_size, base_btf);
Signature · 1 line
2.37.2
#1 lore raw
This patch was applied to bpf/bpf-next.git (master) by Andrii Nakryiko <[email protected]>:

Hello:

This patch was applied to bpf/bpf-next.git (master) by Andrii Nakryiko <[email protected]>:

Quoted 8 lines · On Sat, 31 Dec 2022 23:14:36 +0800 you wrote:

As discussed before, return -ENODATA (No data available) would be more meaningful than ENOENT (No such file or directory).

[...]

Here is the summary with links:
- libbpf: Return -ENODATA for missing btf section

    https://git.kernel.org/bpf/bpf-next/c/acd3b7768048

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html