for (idx = 0; idx < niovecs; idx++) {
cbdsk = (struct CBDiskEntry *) iov[idx].iov_base;
+
+ if (cbdsk->cb.hhead < state->h_map.len &&
+ state->h_map.entries[cbdsk->cb.hhead].valid == FS_STATE_IDX_SKIPPED) {
+ continue;
+ }
+
if ((cb = GetCB()) == NULL) {
ViceLog(0, ("cb_stateRestoreCBs: ran out of free CallBack structures\n"));
ret = 1;
ret = 1;
goto done;
}
+ state->fe_map.entries[in->index].valid = FS_STATE_IDX_VALID;
state->fe_map.entries[in->index].old_idx = in->index;
state->fe_map.entries[in->index].new_idx = fetoi(out);
ret = 1;
goto done;
}
+ state->cb_map.entries[in->index].valid = FS_STATE_IDX_VALID;
state->cb_map.entries[in->index].old_idx = in->index;
state->cb_map.entries[in->index].new_idx = cbtoi(out);
if (old >= state->fe_map.len) {
ViceLog(0, ("fe_OldToNew: index %d is out of range\n", old));
ret = 1;
- } else if (state->fe_map.entries[old].old_idx != old) { /* sanity check */
+ } else if (state->fe_map.entries[old].valid != FS_STATE_IDX_VALID ||
+ state->fe_map.entries[old].old_idx != old) { /* sanity check */
ViceLog(0, ("fe_OldToNew: index %d points to an invalid FileEntry record\n", old));
ret = 1;
} else {
if (old >= state->cb_map.len) {
ViceLog(0, ("cb_OldToNew: index %d is out of range\n", old));
ret = 1;
- } else if (state->cb_map.entries[old].old_idx != old) { /* sanity check */
+ } else if (state->cb_map.entries[old].valid != FS_STATE_IDX_VALID ||
+ state->cb_map.entries[old].old_idx != old) { /* sanity check */
ViceLog(0, ("cb_OldToNew: index %d points to an invalid CallBack record\n", old));
ret = 1;
} else {