Comments
Patch
@@ -175,14 +175,15 @@ gc (struct database_dyn *db)
/* This is the hash entry itself. */
markrange (mark, run, sizeof (struct hashentry));
- /* Add the information for the data itself. We do this
- only for the one special entry marked with FIRST. */
- if (he[cnt]->first)
- {
- struct datahead *dh
- = (struct datahead *) (db->data + he[cnt]->packet);
- markrange (mark, he[cnt]->packet, dh->allocsize);
- }
+ /* Add the information for the data itself. We need to do this
+ for all entries that point to the same data packet, not only
+ the one marked as first. Otherwise if the entry marked as
+ first has already been collected while the secondary entry
+ was added we may miss the reference from the latter one.
+ This can happen when processing an INVALIDATE request. */
+ struct datahead *dh
+ = (struct datahead *) (db->data + he[cnt]->packet);
+ markrange (mark, he[cnt]->packet, dh->allocsize);
run = he[cnt]->next;