All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf-next v2 0/3] Support RENAME_EXCHANGE on bpffs
@ 2021-10-21 15:15 Lorenz Bauer
  2021-10-21 15:15 ` [PATCH bpf-next v2 1/3] libfs: support RENAME_EXCHANGE in simple_rename() Lorenz Bauer
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Lorenz Bauer @ 2021-10-21 15:15 UTC (permalink / raw)
  To: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko
  Cc: kernel-team, Lorenz Bauer, netdev, bpf

Add support for renameat2(RENAME_EXCHANGE) on bpffs. This is useful
for atomic upgrades of our sk_lookup control plane.

* Create a temporary directory on bpffs
* Migrate maps and pin them into temporary directory
* Load new sk_lookup BPF, attach it and pin the link into temp dir
* renameat2(temp dir, state dir, RENAME_EXCHANGE)
* rmdir temp dir

Due to the sk_lookup semantics this means we can never end up in a
situation where an upgrade breaks the existing control plane.

v2:
- Test exchanging a map and a directory (Alexei)
- Use ASSERT macros (Andrii)

Lorenz Bauer (3):
  libfs: support RENAME_EXCHANGE in simple_rename()
  selftests: bpf: convert test_bpffs to ASSERT macros
  selftests: bpf: test RENAME_EXCHANGE and RENAME_NOREPLACE on bpffs

 fs/libfs.c                                    |  6 +-
 .../selftests/bpf/prog_tests/test_bpffs.c     | 85 ++++++++++++++++---
 2 files changed, 79 insertions(+), 12 deletions(-)

-- 
2.32.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-10-28  9:49 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-21 15:15 [PATCH bpf-next v2 0/3] Support RENAME_EXCHANGE on bpffs Lorenz Bauer
2021-10-21 15:15 ` [PATCH bpf-next v2 1/3] libfs: support RENAME_EXCHANGE in simple_rename() Lorenz Bauer
2021-10-22  0:34   ` Alexei Starovoitov
2021-10-27 23:21   ` Daniel Borkmann
2021-10-28  8:43     ` Miklos Szeredi
2021-10-28  9:49       ` Lorenz Bauer
2021-10-21 15:15 ` [PATCH bpf-next v2 2/3] selftests: bpf: convert test_bpffs to ASSERT macros Lorenz Bauer
2021-10-21 15:15 ` [PATCH bpf-next v2 3/3] selftests: bpf: test RENAME_EXCHANGE and RENAME_NOREPLACE on bpffs Lorenz Bauer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.