1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2024-12-25 09:19:31 +00:00

Merge pull request #1274 from ThomasWaldmann/healthy-chunks-list

repair: remember the good chunks
This commit is contained in:
TW 2016-07-06 22:59:56 +02:00 committed by GitHub
commit acda5bc845

View file

@ -701,7 +701,7 @@ def _open_rb(path):
# this set must be kept complete, otherwise the RobustUnpacker might malfunction:
ITEM_KEYS = frozenset([b'path', b'source', b'rdev', b'chunks',
ITEM_KEYS = frozenset([b'path', b'source', b'rdev', b'chunks', b'chunks_healthy',
b'mode', b'user', b'group', b'uid', b'gid', b'mtime', b'atime', b'ctime',
b'xattrs', b'bsdflags', b'acl_nfs4', b'acl_access', b'acl_default', b'acl_extended', ])
@ -933,6 +933,9 @@ def verify_file_chunks(item):
add_reference(chunk_id, size, csize)
chunk_list.append((chunk_id, size, csize))
offset += size
if b'chunks_healthy' not in item:
# if this is first repair, remember the correct chunk IDs, so we can maybe heal the file later
item[b'chunks_healthy'] = item[b'chunks']
item[b'chunks'] = chunk_list
def robust_iterator(archive):