mirror of
https://github.com/borgbackup/borg.git
synced 2026-06-13 19:00:44 -04:00
Merge pull request #4967 from ThomasWaldmann/fix-hashindex-set-1.1
fix bug in hashindex_set on resize, fixes #4829
This commit is contained in:
commit
6c49ad5bc3
1 changed files with 10 additions and 0 deletions
|
|
@ -562,6 +562,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 = start_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 a new issue