mirror of
https://github.com/restic/restic.git
synced 2026-07-12 10:15:08 +00:00
fuse: reset treeCache on snapshot reload to fix stale latest symlink (#21873)
The treeCache in SnapshotsDir was never cleared when snapshots were reloaded. This caused the "latest" symlink to keep pointing to the previous snapshot even after new snapshots were added. Add a generation counter to SnapshotsDirStructure that is incremented whenever the directory structure is rebuilt (in makeDirs). The treeCache checks this generation on each lookup and resets itself when the generation changes, ensuring cached nodes (including symlinks) are refreshed after a snapshot reload.
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
Bugfix: Update `mount` latest symlink after snapshot reload
|
||||
|
||||
When `restic mount` was kept running while new snapshots were
|
||||
created, the new snapshots appeared in the mountpoint, but the `latest`
|
||||
symlink could still point to the previously latest snapshot. Restic now
|
||||
invalidates the cached snapshot directory entries after a snapshot reload so
|
||||
that `latest` points to the newest snapshot.
|
||||
|
||||
https://github.com/restic/restic/issues/5722
|
||||
https://github.com/restic/restic/pull/21873
|
||||
Reference in New Issue
Block a user