[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20231104024444.385484-1-chen.dylane@gmail.com>
Date: Sat, 4 Nov 2023 10:44:44 +0800
From: Tao Chen <chen.dylane@...il.com>
To: song@...nel.org, jolsa@...nel.org, ast@...nel.org,
daniel@...earbox.net, andrii@...nel.org, yonghong.song@...ux.dev,
martin.lau@...ux.dev, john.fastabend@...il.com, haoluo@...gle.com
Cc: bpf@...r.kernel.org, linux-kernel@...r.kernel.org,
chen.dylane@...il.com
Subject: [PATCH] bpf: Use E2BIG instead of ENOENT
Use E2BIG instead of ENOENT when the key size beyond the buckets size,
it seems more meaningful.
Signed-off-by: Tao Chen <chen.dylane@...il.com>
---
kernel/bpf/stackmap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/bpf/stackmap.c b/kernel/bpf/stackmap.c
index 458bb80b14d5..b78369bdec8d 100644
--- a/kernel/bpf/stackmap.c
+++ b/kernel/bpf/stackmap.c
@@ -570,7 +570,7 @@ int bpf_stackmap_copy(struct bpf_map *map, void *key, void *value)
u32 id = *(u32 *)key, trace_len;
if (unlikely(id >= smap->n_buckets))
- return -ENOENT;
+ return -E2BIG;
bucket = xchg(&smap->buckets[id], NULL);
if (!bucket)
--
2.34.1
Powered by blists - more mailing lists