diff --git a/src/tviced/serialize_state.h b/src/tviced/serialize_state.h index 6478e714ea..2a34723d4a 100644 --- a/src/tviced/serialize_state.h +++ b/src/tviced/serialize_state.h @@ -41,6 +41,7 @@ /* values for the 'valid' field in idx_map_entry_t */ #define FS_STATE_IDX_VALID 1 +#define FS_STATE_IDX_SKIPPED 2 /* * on-disk structures diff --git a/src/viced/callback.c b/src/viced/callback.c index 4da7d73edf..bb6ec684ea 100644 --- a/src/viced/callback.c +++ b/src/viced/callback.c @@ -2456,6 +2456,12 @@ cb_stateRestoreCBs(struct fs_dump_state * state, struct FileEntry * fe, 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; diff --git a/src/viced/host.c b/src/viced/host.c index 7f94344193..558f7a714f 100644 --- a/src/viced/host.c +++ b/src/viced/host.c @@ -3367,6 +3367,16 @@ h_stateRestoreHost(struct fs_dump_state * state) osi_Assert(hcps != NULL); } + if ((hdsk.hostFlags & HWHO_INPROGRESS) || !(hdsk.hostFlags & ALTADDR)) { + char hoststr[16]; + ViceLog(0, ("h_stateRestoreHost: skipping host %s:%d due to invalid flags 0x%x\n", + afs_inet_ntoa_r(hdsk.host, hoststr), (int)ntohs(hdsk.port), + (unsigned)hdsk.hostFlags)); + bail = 0; + state->h_map.entries[hdsk.index].valid = FS_STATE_IDX_SKIPPED; + goto done; + } + /* for restoring state, we better be able to get a host! */ host = GetHT(); osi_Assert(host != NULL);