]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/bpf: Test RENAME_EXCHANGE and RENAME_NOREPLACE on bpffs
authorLorenz Bauer <lmb@cloudflare.com>
Thu, 28 Oct 2021 09:47:24 +0000 (10:47 +0100)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 3 Nov 2021 14:43:08 +0000 (15:43 +0100)
commit6fbe3d4caa321a025a50ae9954821110bab6d4fd
tree48069acb1c0338b75ac50e559876d354ed24b96a
parent8abc24fa8781927e8639f3135157d1de665a1536
selftests/bpf: Test RENAME_EXCHANGE and RENAME_NOREPLACE on bpffs

Add tests to exercise the behaviour of RENAME_EXCHANGE and RENAME_NOREPLACE
on bpffs. The former checks that after an exchange the inode of two
directories has changed. The latter checks that the source still exists
after a failed rename. Generally, having support for renameat2(RENAME_EXCHANGE)
in bpffs fixes atomic upgrades of our sk_lookup control plane.

Signed-off-by: Lorenz Bauer <lmb@cloudflare.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20211028094724.59043-5-lmb@cloudflare.com
tools/testing/selftests/bpf/prog_tests/test_bpffs.c