[PATCH proxmox-backup 0/4] don't hold datastore config lock during s3-refresh

Christian Ebner
2026-05-05T08:12:11Z

Currently an s3-refresh runs while holding the datastore config lock,
with the intention to block from accidentail leaving the
corresponding maintenance mode, assuring consistency.
However, this also blocks config access by all unrelated datastores,
similar to mount/unmount for removable datastores, but for s3-refresh
this is not acceptable since it can take significantly more time or
block on network issues until timeouts are reached.

Instead, implement per-datastore locks for maintenance-mode changes,
and rely on these to block unexpected maintenance-mode changes.

The first 3 patches are code style and refactoring only, the last patch
actually introduces the maintenance-mode locks.

Reported in the community forum: https://forum.proxmox.com/threads/183244/

Christian Ebner (4):
pbs-config: reorganize crate use statements
datastore: move lock files base path constant to central location
datastore: move file lock helper to centralized place
api/datastore: use maintenance-mode lock to protect against changes

pbs-config/src/lib.rs | 18 +++++++------
pbs-datastore/src/backup_info.rs | 36 ++-----------------------
pbs-datastore/src/chunk_store.rs | 5 ++--
pbs-datastore/src/datastore.rs | 2 ++
pbs-datastore/src/lib.rs | 45 +++++++++++++++++++++++++++++++
pbs-datastore/src/move_journal.rs | 2 +-
src/api2/admin/datastore.rs | 26 +++++++++++++-----
src/api2/config/datastore.rs | 6 ++++-
8 files changed, 87 insertions(+), 53 deletions(-)

--
2.47.3