mirror of
https://github.com/borgbackup/borg.git
synced 2024-12-23 00:07:38 +00:00
Merge pull request #6055 from ThomasWaldmann/fix-hl-preload-master
fix hardlinkable file type check, fixes #6037
This commit is contained in:
commit
ef6a65214e
1 changed files with 15 additions and 13 deletions
|
@ -288,13 +288,15 @@ def _preload(chunks):
|
||||||
# corresponding hardlink slave is selected (== is extracted).
|
# corresponding hardlink slave is selected (== is extracted).
|
||||||
# due to a side effect of the filter() call, we now have hardlink_masters dict populated.
|
# due to a side effect of the filter() call, we now have hardlink_masters dict populated.
|
||||||
for item in items:
|
for item in items:
|
||||||
if 'chunks' in item: # regular file, maybe a hardlink master
|
if hardlinkable(item.mode):
|
||||||
|
source = item.get('source')
|
||||||
|
if source is None: # maybe a hardlink master
|
||||||
|
if 'chunks' in item:
|
||||||
_preload(item.chunks)
|
_preload(item.chunks)
|
||||||
# if this is a hardlink master, remember that we already preloaded it:
|
# if this is a hl master, remember that we already preloaded all chunks of it (if any):
|
||||||
if 'source' not in item and hardlinkable(item.mode) and item.get('hardlink_master', True):
|
if item.get('hardlink_master', True):
|
||||||
masters_preloaded.add(item.path)
|
masters_preloaded.add(item.path)
|
||||||
elif 'source' in item and hardlinkable(item.mode): # hardlink slave
|
else: # hardlink slave
|
||||||
source = item.source
|
|
||||||
if source not in masters_preloaded:
|
if source not in masters_preloaded:
|
||||||
# we only need to preload *once* (for the 1st selected slave)
|
# we only need to preload *once* (for the 1st selected slave)
|
||||||
chunks, _ = hardlink_masters[source]
|
chunks, _ = hardlink_masters[source]
|
||||||
|
|
Loading…
Reference in a new issue