+20
−21
Loading
stable inclusion from stable-v6.6.66 commit 2e9ff3f4834c873b4c768091a83322f4ed4c95cf category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IBFB6E Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=2e9ff3f4834c873b4c768091a83322f4ed4c95cf -------------------------------- [ Upstream commit 532d6b36b2bfac5514426a97a4df8d103d700d43 ] When a LPM trie is full, in-place updates of existing elements incorrectly return -ENOSPC. Fix this by deferring the check of trie->n_entries. For new insertions, n_entries must not exceed max_entries. However, in-place updates are allowed even when the trie is full. Fixes: b95a5c4d ("bpf: add a longest prefix match trie map implementation") Reviewed-by:Toke Høiland-Jørgensen <toke@redhat.com> Signed-off-by:
Hou Tao <houtao1@huawei.com> Link: https://lore.kernel.org/r/20241206110622.1161752-5-houtao@huaweicloud.com Signed-off-by:
Alexei Starovoitov <ast@kernel.org> Signed-off-by:
Sasha Levin <sashal@kernel.org> Conflicts: kernel/bpf/lpm_trie.c [The cleanup patch 3d5611b4d7ef did not backport, causing conflicts] Signed-off-by:
Tengda Wu <wutengda2@huawei.com>