]> www.infradead.org Git - users/willy/pagecache.git/commit
Merge branch 'bpf-skip-non-exist-keys-in-generic_map_lookup_batch'
authorAlexei Starovoitov <ast@kernel.org>
Wed, 19 Feb 2025 01:27:37 +0000 (17:27 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 19 Feb 2025 01:27:38 +0000 (17:27 -0800)
commitdbf7cc560007c8624ba42bbda369eca2973fc2da
treeab103de524ca96dab1b887b56207fce9d0237a9f
parent8784714d7f27045c7cb72456cf66705b73fbc804
parentd66b7739176d513b81db8b18e8677e30f1b67574
Merge branch 'bpf-skip-non-exist-keys-in-generic_map_lookup_batch'

Yan Zhai says:

====================
bpf: skip non exist keys in generic_map_lookup_batch

The generic_map_lookup_batch currently returns EINTR if it fails with
ENOENT and retries several times on bpf_map_copy_value. The next batch
would start from the same location, presuming it's a transient issue.
This is incorrect if a map can actually have "holes", i.e.
"get_next_key" can return a key that does not point to a valid value. At
least the array of maps type may contain such holes legitly. Right now
these holes show up, generic batch lookup cannot proceed any more. It
will always fail with EINTR errors.

This patch fixes this behavior by skipping the non-existing key, and
does not return EINTR any more.

V2->V3: deleted a unused macro
V1->V2: split the fix and selftests; fixed a few selftests issues.

V2: https://lore.kernel.org/bpf/cover.1738905497.git.yan@cloudflare.com/
V1: https://lore.kernel.org/bpf/Z6OYbS4WqQnmzi2z@debian.debian/
====================

Link: https://patch.msgid.link/cover.1739171594.git.yan@cloudflare.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>