bpf: return EOPNOTSUPP when map lookup isn't supported
authorPrashant Bhole <bhole_prashant_q7@lab.ntt.co.jp>
Tue, 9 Oct 2018 01:04:50 +0000 (10:04 +0900)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 10 Oct 2018 04:52:20 +0000 (21:52 -0700)
commit3b4a63f674e94795c9b76a41b36364b8aec232e1
treee5dae37fa352f22915e661a36af033b646bcdede
parent509db2833e0ddac7faf6e7d2dd6e7f85c98fbee0
bpf: return EOPNOTSUPP when map lookup isn't supported

Return ERR_PTR(-EOPNOTSUPP) from map_lookup_elem() methods of below
map types:
- BPF_MAP_TYPE_PROG_ARRAY
- BPF_MAP_TYPE_STACK_TRACE
- BPF_MAP_TYPE_XSKMAP
- BPF_MAP_TYPE_SOCKMAP/BPF_MAP_TYPE_SOCKHASH

Signed-off-by: Prashant Bhole <bhole_prashant_q7@lab.ntt.co.jp>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/arraymap.c
kernel/bpf/sockmap.c
kernel/bpf/stackmap.c
kernel/bpf/xskmap.c