- if (le32_to_cpu(rec->lrh_type) != LLOG_LOGID_MAGIC) {
- CERROR("invalid record in catalog\n");
- RETURN(-EINVAL);
- }
- CDEBUG(D_HA, "processing log "DFID":%x at index %u of catalog "
- DFID"\n", PFID(&lir->lid_id.lgl_oi.oi_fid), lir->lid_id.lgl_ogen,
- le32_to_cpu(rec->lrh_index),
- PFID(&cat_llh->lgh_id.lgl_oi.oi_fid));
-
- rc = llog_cat_id2handle(env, cat_llh, &llh, &lir->lid_id);
- if (rc) {
- CERROR("%s: cannot find handle for llog "DFID": rc = %d\n",
- cat_llh->lgh_ctxt->loc_obd->obd_name,
- PFID(&lir->lid_id.lgl_oi.oi_fid), rc);
- if (rc == -ENOENT || rc == -ESTALE) {
- /* After a server crash, a stub of index
- * record in catlog could be kept, because
- * plain log destroy + catlog index record
- * deletion are not atomic. So we end up with
- * an index but no actual record. Destroy the
- * index and move on. */
- rc = llog_cat_cleanup(env, cat_llh, NULL,
- rec->lrh_index);
- }
-