(int)aslot, off);
}
- if (!entryok || !datavalid) {
+ if (indexvalid && !datavalid) {
+ /* we know that the given dslot does exist, but the data in it is not
+ * valid. this only occurs when we pull a dslot from the free or
+ * discard list, so be sure not to re-use the data; force invalidation.
+ */
+ entryok = 0;
+ }
+
+ if (!entryok) {
tdc->f.fid.Cell = 0;
tdc->f.fid.Fid.Volume = 0;
tdc->f.chunk = -1;