debian-forge/osbuild
David Rheinsberg e6b77ac7df util/fscache: avoid RENAME_NOREPLACE in _atomic_file()
The `RENAME_NOREPLACE` option is not available on NFS. Avoid using it
in _atomic_file() to allow NFS backed storage.

If the caller allows replacing the destination entry, we simply use the
original `os.rename()` system call. This will unconditionally replace
the destination on all file-systems.

If the caller requests `no-replace`, we cannot use `os.rename()`.
Instead, we use `os.link()` to create a new hard-link on the
destination. This will always fail if the destination already exists.
We then rely on the cleanup-path to unlink the original temporary
entry.

This will require adjustments in future maintenance tasks on the cache,
since they need to be aware that entries can be hardlinked temporarily.
However, we already consider `uuid-*` entries in the object-store to be
temporary and unaccounted for similar reasons, so this doesn't even
break our cache-maintenance ideas.

Signed-off-by: David Rheinsberg <david.rheinsberg@gmail.com>
2022-12-20 16:56:32 +01:00
..
formats format: read metadata from object not result 2022-12-09 12:03:40 +01:00
util util/fscache: avoid RENAME_NOREPLACE in _atomic_file() 2022-12-20 16:56:32 +01:00
__init__.py Post release version bump 2022-12-07 08:15:17 +00:00
__main__.py osbuild: run isort on all files 2022-09-12 13:32:51 +02:00
api.py pipeline,api: write metadata directly 2022-12-09 12:03:40 +01:00
buildroot.py buildroot: explicitly bind mount runner 2022-10-11 12:49:16 +02:00
devices.py devices: new helper to ensure a device node exists 2022-11-22 18:28:38 +01:00
host.py osbuild: run isort on all files 2022-09-12 13:32:51 +02:00
inputs.py osbuild: run isort on all files 2022-09-12 13:32:51 +02:00
loop.py loop: silence W0201 (attribute outside init) in set_status 2022-05-06 17:33:23 +02:00
main_cli.py osbuid: integrate FsCache into ObjectStore 2022-12-09 12:03:40 +01:00
meta.py meta: ensure we have an absolute path for Index 2022-10-11 12:49:16 +02:00
monitor.py monitor: show pipeline's source epoch 2022-12-15 13:10:35 +00:00
mounts.py mounts: use the options object for mountopts 2022-11-30 14:21:10 +01:00
objectstore.py util/fscache: provide store_tree() helper 2022-12-20 16:56:32 +01:00
pipeline.py pipeline: set source_epoch for tree 2022-12-15 13:10:35 +00:00
remoteloop.py osbuild: run isort on all files 2022-09-12 13:32:51 +02:00
sources.py osbuild: run isort on all files 2022-09-12 13:32:51 +02:00