}
if (unlikely(logid_id(&cid->lci_logid) == 0)) {
+renew:
rc = llog_open_create(env, ctxt, &lgh, NULL, NULL);
if (rc < 0)
GOTO(out_put, rc);
LASSERT(lgh != NULL);
rc = llog_init_handle(env, lgh, LLOG_F_IS_CAT, NULL);
- if (rc != 0)
+ if (rc) {
+ /* Update llog is corruption, renew it */
+ if (rc == -EIO && need_put == false) {
+ llog_cat_close(env, lgh);
+ GOTO(renew, 0);
+ }
GOTO(out_close, rc);
+ }
if (need_put) {
rc = llog_osd_put_cat_list(env, dt, index, 1, cid, fid);
CERROR("%s: error reading "DFID" log header size %d: rc = %d\n",
o->do_lu.lo_dev->ld_obd->obd_name,
PFID(lu_object_fid(&o->do_lu)), rc < 0 ? 0 : rc,
- -EFAULT);
+ -EIO);
if (rc >= 0)
- rc = -EFAULT;
+ rc = -EIO;
GOTO(unlock, rc);
}