OSDN Git Service

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)
commit7e5ad817ec297f91a2fa5c423a39a458a4701bca
tree48069acb1c0338b75ac50e559876d354ed24b96a
parent9fc23c22e5745decc93ba5789bdcf2b093f21145
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