if (freespace > (128 << 20))
loghandle->lgh_max_size = 128 << 20;
}
+ if (unlikely(OBD_FAIL_PRECHECK(OBD_FAIL_PLAIN_RECORDS) ||
+ OBD_FAIL_PRECHECK(OBD_FAIL_CATALOG_FULL_CHECK))) {
+ // limit the numer of plain records for test
+ loghandle->lgh_max_size = loghandle->lgh_hdr_size +
+ cfs_fail_val * 64;
+ }
+
rc = 0;
out:
cgl->lgl_ogen, logid->lgl_ogen);
continue;
}
+ *res = llog_handle_get(loghandle);
+ if (!*res) {
+ CERROR("%s: log "DFID" refcount is zero!\n",
+ loghandle->lgh_ctxt->loc_obd->obd_name,
+ PFID(&logid->lgl_oi.oi_fid));
+ continue;
+ }
loghandle->u.phd.phd_cat_handle = cathandle;
up_write(&cathandle->lgh_lock);
- GOTO(out, rc = 0);
+ RETURN(rc);
}
}
up_write(&cathandle->lgh_lock);
rc = llog_init_handle(env, loghandle, LLOG_F_IS_PLAIN | fmt, NULL);
if (rc < 0) {
llog_close(env, loghandle);
- loghandle = NULL;
+ *res = NULL;
RETURN(rc);
}
+ *res = llog_handle_get(loghandle);
+ LASSERT(*res);
down_write(&cathandle->lgh_lock);
list_add_tail(&loghandle->u.phd.phd_entry, &cathandle->u.chd.chd_head);
up_write(&cathandle->lgh_lock);
loghandle->u.phd.phd_cookie.lgc_lgl = cathandle->lgh_id;
loghandle->u.phd.phd_cookie.lgc_index =
loghandle->lgh_hdr->llh_cat_idx;
- EXIT;
-out:
- llog_handle_get(loghandle);
- *res = loghandle;
- return 0;
+ RETURN(0);
}
int llog_cat_close(const struct lu_env *env, struct llog_handle *cathandle)
cathandle->lgh_ctxt->loc_obd->obd_name,
PFID(&lgl->lgl_oi.oi_fid), lgl->lgl_ogen, rc);
- llog_handle_put(loghandle);
+ llog_handle_put(env, loghandle);
RETURN(rc);
}
rc = 0;
}
- llog_handle_put(loghandle);
+ llog_handle_put(env, loghandle);
if (rc)
CERROR("%s: fail to cancel %d llog-records: rc = %d\n",
}
if (llh)
- llog_handle_put(llh);
+ llog_handle_put(env, llh);
RETURN(rc);
}
* catalog bottom.
*/
startcat = 0;
+ d.lpd_startcat = 0;
if (rc != 0)
RETURN(rc);
}
}
if (llh != NULL)
- llog_handle_put(llh);
+ llog_handle_put(env, llh);
RETURN(0);
}
rc = llog_cat_cleanup(env, cat_llh, llh,
llh->u.phd.phd_cookie.lgc_index);
- llog_handle_put(llh);
+ llog_handle_put(env, llh);
RETURN(rc);
}