mirror of https://github.com/borgbackup/borg.git
Merge pull request #4968 from ThomasWaldmann/fix-hashindex-set-1.0
fix bug in hashindex_set on resize, fixes #4829 (1.0-maint backport)
This commit is contained in:
commit
387646864f
|
@ -449,6 +449,16 @@ hashindex_set(HashIndex *index, const void *key, const void *value)
|
|||
if(!hashindex_resize(index, index->num_buckets)) {
|
||||
return 0;
|
||||
}
|
||||
/* we have just built a fresh hashtable and removed all tombstones,
|
||||
* so we only have EMPTY or USED buckets, but no DELETED ones any more.
|
||||
*/
|
||||
idx = hashindex_index(index, key);
|
||||
while(!BUCKET_IS_EMPTY(index, idx)) {
|
||||
idx++;
|
||||
if (idx >= index->num_buckets){
|
||||
idx -= index->num_buckets;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
ptr = BUCKET_ADDR(index, idx);
|
||||
|
|
Loading…
Reference in New Issue