backup: touch all chunks, even if they exist
We need to update the atime of chunk files if they already exist, otherwise a concurrently running GC could sweep them away. This is protected with ChunkStore.mutex, so the fstat/unlink does not race with touching. Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
This commit is contained in:
parent
a9767cf7de
commit
068e526862
@ -414,6 +414,7 @@ impl ChunkStore {
|
||||
|
||||
if let Ok(metadata) = std::fs::metadata(&chunk_path) {
|
||||
if metadata.is_file() {
|
||||
self.touch_chunk(digest)?;
|
||||
return Ok((true, metadata.len()));
|
||||
} else {
|
||||
bail!("Got unexpected file type on store '{}' for chunk {}", self.name, digest_str);
|
||||
|
Loading…
Reference in New Issue
Block a user