diff --git a/src/vlserver/vldb_check.c b/src/vlserver/vldb_check.c index 59f75d8ecf..55d8518590 100644 --- a/src/vlserver/vldb_check.c +++ b/src/vlserver/vldb_check.c @@ -1433,8 +1433,9 @@ WorkerBee(struct cmd_syndesc *as, void *arock) if (fix) { /* - * If we are fixing we will rebuild all the hash lists from the ground up + * If we are fixing we will rebuild the free and hash lists from the ground up. */ + header.vital_header.freePtr = 0; memcpy(oldnamehash, header.VolnameHash, sizeof(oldnamehash)); memset(header.VolnameHash, 0, sizeof(header.VolnameHash)); @@ -1589,6 +1590,18 @@ WorkerBee(struct cmd_syndesc *as, void *arock) } writeMH(record[i].addr, block, MHblock); } + } else if (record[i].type & FR) { + if (fix) { + readentry(record[i].addr, &vlentry, &type); + vlentry.nextIdHash[0] = header.vital_header.freePtr; + header.vital_header.freePtr = record[i].addr; + if ((record[i].type & FRC) == 0) { + quiet_println + ("FIX: Putting free entry on the free chain: addr=%lu (offset 0x%0x)\n", + record[i].addr, OFFSET(record[i].addr)); + } + writeentry(record[i].addr, &vlentry); + } } } if (fix) {