]> git.proxmox.com Git - proxmox-backup.git/commit
backup: index readers: drop useless shared lock
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 9 Oct 2020 10:45:36 +0000 (12:45 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 9 Oct 2020 10:59:31 +0000 (12:59 +0200)
commitfe0efb25e8bd7e1c2f917d9617dc45e6532cb5cd
tree5f1823fb17a6e52f308ae135dfe5356849f867bb
parentb0b00c4a475dc1c2b936121a75e69c3705a4e155
backup: index readers: drop useless shared lock

This is only acquired in those two methods, both as shared. So it has
no use.

It seems, that it was planned in the past that the index deletion
should take the exclusive, while read and write takes the shared
flock on the index, as one can guess from the lock comments in commit
046521895307aa8bde8bab7ea3ef9e437d5ab5e5

But then later, in commit c8ec450e379f54e7ac648b3a3ff701b37e9a6620)
the documented semantics where changed to use a temp file and do an
atomic rename instead for atomicity.

The reader shared flock on the index file was done inbetween,
probably as preparatory step, but was not removed again when strategy
was changed to using the file rename instead.

Do so now, to avoid confusion of readers and a useless flock.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/backup/dynamic_index.rs
src/backup/fixed_index.rs