CWARN("too long recovery - read logs\n");
libcfs_debug_dumplog();
}
+
target_finish_recovery(obd);
lu_env_fini(&env);
rc = obd_fid_alloc(exp, fid, hint);
if (rc) {
- CERROR("cannot allocate new fid, rc %d\n", rc);
+ CERROR("Can't allocate new fid, rc %d\n", rc);
RETURN(rc);
}
.ph_opc = LUSTRE_OPC_CREATE };
rc = ll_fid_md_alloc(ll_i2sbi(parent), &op_data->fid2, &hint);
- if (rc) {
- CERROR("can't allocate new fid, rc %d\n", rc);
+ if (rc)
LBUG();
- }
}
it->it_create_mode &= ~current->fs->umask;
rc = lmv_placement_policy(obd, hint, &mds);
if (rc) {
- CERROR("can't get target for allocating fid, "
+ CERROR("Can't get target for allocating fid, "
"rc %d\n", rc);
RETURN(rc);
}
rc = fld_client_create(&lmv->lmv_fld, fid_seq(fid),
mds, NULL);
if (rc) {
- CERROR("can't create fld entry, rc %d\n", rc);
+ CERROR("Can't create fld entry, rc %d\n", rc);
RETURN(rc);
}
}
if (rc)
GOTO(out_free_seq, rc);
- /* pre-allocate meta-sequence */
- rc = seq_client_alloc_meta(cli->cl_seq, NULL);
- if (rc) {
- CERROR("Can't allocate new meta-sequence, "
- "rc %d\n", rc);
- GOTO(out_free_seq, rc);
- }
RETURN(rc);
out_free_seq:
if (new_lock == NULL)
new_lock = ldlm_handle2lock(&lh->mlh_lh);
- if (new_lock == NULL && (flags & LDLM_FL_INTENT_ONLY))
+ if (new_lock == NULL && (flags & LDLM_FL_INTENT_ONLY)) {
+ lh->mlh_lh.cookie = 0;
RETURN(0);
+ }
LASSERTF(new_lock != NULL,
"lockh "LPX64"\n", lh->mlh_lh.cookie);
*/
LASSERT(lustre_msg_get_flags(req->rq_reqmsg) &
MSG_RESENT);
+ lh->mlh_lh.cookie = 0;
RETURN(ELDLM_LOCK_REPLACED);
}
RETURN(rc);
}
+
/*
* Init client sequence manager which is used by local MDS to talk to sequence
* controller on remote node.
struct obd_device *mdc;
struct obd_uuid *uuidp, *mdcuuidp;
char *uuid_str, *mdc_uuid_str;
- int rc;
- int index;
+ int rc;
+ int index;
struct mdt_thread_info *info;
char *p, *index_string = lustre_cfg_string(cfg, 2);
ENTRY;
if (lcfg->lcfg_command == LCFG_MARKER) {
struct cfg_marker *marker;
marker = lustre_cfg_buf(lcfg, 1);
- if(!strncmp(marker->cm_comment,"add osc",7) &&
- (marker->cm_flags & CM_START)){
+ if (!strncmp(marker->cm_comment,"add osc",7) &&
+ (marker->cm_flags & CM_START)){
got_an_osc_or_mdc = 1;
rc = record_start_log(obd, &mdt_llh, mti->mti_svname);
rc = record_marker(obd, mdt_llh, fsdb, CM_START,
last_step = marker->cm_step;
RETURN(rc);
}
- if(!strncmp(marker->cm_comment,"add osc",7) &&
- (marker->cm_flags & CM_END)){
+ if (!strncmp(marker->cm_comment,"add osc",7) &&
+ (marker->cm_flags & CM_END)){
LASSERT(last_step == marker->cm_step);
last_step = -1;
got_an_osc_or_mdc = 0;
rc = record_end_log(obd, &mdt_llh);
RETURN(rc);
}
- if(!strncmp(marker->cm_comment,"add mdc",7) &&
- (marker->cm_flags & CM_START)){
+ if (!strncmp(marker->cm_comment,"add mdc",7) &&
+ (marker->cm_flags & CM_START)){
got_an_osc_or_mdc = 2;
last_step = marker->cm_step;
memcpy(tmti->mti_svname, marker->cm_svname,
RETURN(rc);
}
- if(!strncmp(marker->cm_comment,"add mdc",7) &&
- (marker->cm_flags & CM_END)){
+ if (!strncmp(marker->cm_comment,"add mdc",7) &&
+ (marker->cm_flags & CM_END)){
LASSERT(last_step == marker->cm_step);
last_step = -1;
got_an_osc_or_mdc = 0;
target = lustre_cfg_string(lcfg, 1);
memcpy(tmti->mti_uuid, target, strlen(target));
-
RETURN(rc);
}
if (lcfg->lcfg_command == LCFG_SEC_FLAVOR) {
memcpy(sec_conf, lustre_cfg_buf(lcfg, 1), sizeof(*sec_conf));
-
RETURN(rc);
}
RETURN(-ENOMEM);
name_create(&lovname, log, "-mdtlov");
- if (mgs_log_is_empty(obd, log)) {
+ if (mgs_log_is_empty(obd, log))
rc = mgs_write_log_lov(obd, fsdb, mti, log, lovname);
- }
sprintf(uuid, "%s_UUID", log);
sprintf(mdt_index,"%d",mti->mti_stripe_index);
+
/* add MDT itself */
rc = record_start_log(obd, &llh, log);
if (rc)
LASSERTF(obd->obd_magic == OBD_DEVICE_MAGIC, "obd %p obd_magic %08x != %08x\n",
obd, obd->obd_magic, OBD_DEVICE_MAGIC);
+ obd->obd_configured = 0;
+
/* have we attached a type to this device? */
if (!obd->obd_attached) {
CERROR("Device %d not attached\n", obd->obd_minor);
GOTO(err_exp, err);
obd->obd_set_up = 1;
+
spin_lock(&obd->obd_dev_lock);
/* cleanup drops this */
class_incref(obd);
if (!(clli->cfg_flags & CFG_F_COMPAT146) &&
!(clli->cfg_flags & CFG_F_MARKER) &&
(lcfg->lcfg_command != LCFG_MARKER)) {
- CWARN("Config not inside markers, ignoring! (%#x)\n",
+ CWARN("Config not inside markers, ignoring! "
+ "(inst: %s, uuid: %s, flags: %#x)\n",
+ clli->cfg_instance, clli->cfg_uuid,
clli->cfg_flags);
clli->cfg_flags |= CFG_F_SKIP;
}
struct obd_device *obd;
ENTRY;
- /*XXX: This is fast fix to mountconf issue when osc are set up
- * while recovery is in progress already.
- * The MDS should wait the end of config llog parsing before starting
- * recovery. This is done via obd_configured flag for now
+ /*
+ * XXX: This is fast fix to mountconf issue when osc are set up while
+ * recovery is in progress already. The MDS should wait the end of
+ * config llog parsing before starting recovery. This is done via
+ * obd_configured flag for now.
*/
obd = class_name2obd(name);
- if (obd) {
+ if (obd)
obd->obd_configured = 1;
+ else {
+ CWARN("OBD \"%s\" is not found - skipped.\n", name);
}
EXIT;
}
rc = llog_process(llh, class_config_llog_handler, cfg, &cd);
- class_config_notify_end(name);
-
CDEBUG(D_CONFIG, "Processed log %s gen %d-%d (rc=%d)\n", name,
cd.first_idx + 1, cd.last_idx, rc);
+
+ if (rc == 0) {
+ class_config_notify_end(name);
+ CDEBUG(D_CONFIG, "Notify config log %s parse finish\n",
+ name);
+ } else {
+ CDEBUG(D_CONFIG, "Log %s did not parse, obd is not "
+ "configured.\n", name);
+ }
if (cfg)
cfg->cfg_last_idx = cd.last_idx;
* best to start a transaction with h_sync, because we removed this
* from lastobjid */
- target_stop_recovery_thread(obd);
- target_cleanup_recovery(obd);
-
push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
rc = filter_update_server_data(obd, filter->fo_rcvd_filp,
filter->fo_fsd, 0);
lquota_cleanup(quota_interface, obd);
+ /* Stop recovery before namespace cleanup. */
+ target_stop_recovery_thread(obd);
+ target_cleanup_recovery(obd);
+
ldlm_namespace_free(obd->obd_namespace, obd->obd_force);
if (obd->u.obt.obt_sb == NULL)
uuid = (struct obd_uuid *) uuid_obj.data;
target = class_uuid2obd(uuid);
- if (!target || target->obd_stopping || !target->obd_set_up) {
+ if (!target || target->obd_stopping || !target->obd_set_up ||
+ !target->obd_configured) {
CERROR("target '%s' is not available for context init (%s)",
uuid->uuid, target == NULL ? "no target" :
(target->obd_stopping ? "stopping" : "not set up"));
}
test_0c() {
+ if test $MDSCOUNT != 0; then
+ echo "Skipped for LMV config"
+ return 0;
+ fi
local label=`mdsdevlabel 1`
- [ -z "$label" ] && echo "No label for mds1" && exit 1
+ [ -z "$label" ] && echo "No label for mds1" && return 1
replay_barrier $SINGLEMDS
local sw=`seq_get_width $label`