LASSERT(range_is_sane(space));
if (in != NULL) {
- CDEBUG(D_INFO|D_WARNING, "%s: Recovery started. Use input "
- "(last allocated) range "DRANGE"\n", seq->lss_name,
- PRANGE(in));
+ CDEBUG(D_INFO|D_WARNING, "%s: Input seq range: "
+ DRANGE"\n", seq->lss_name, PRANGE(in));
- if (in->lr_start > space->lr_start)
- space->lr_start = in->lr_start;
+ if (in->lr_end > space->lr_start)
+ space->lr_start = in->lr_end;
*out = *in;
- CDEBUG(D_INFO|D_WARNING, "%s: Recovery finished. Recovered "
- "space: "DRANGE"\n", seq->lss_name, PRANGE(space));
+ CDEBUG(D_INFO|D_WARNING, "%s: Recovered space: "DRANGE"\n",
+ seq->lss_name, PRANGE(space));
} else {
if (range_space(space) < seq->lss_width) {
CWARN("%s: Sequences space to be exhausted soon. "
rc = seq_store_write(seq, env);
if (rc) {
- CERROR("%s: Can't save state, rc %d\n", seq->lss_name, rc);
+ CERROR("%s: Can't save state, rc %d\n",
+ seq->lss_name, rc);
RETURN(rc);
}
* it is allocated from new super.
*/
if (in != NULL) {
- CDEBUG(D_INFO|D_WARNING, "%s: Recovery started. Use input "
- "(last allocated) range "DRANGE"\n", seq->lss_name,
- PRANGE(in));
+ CDEBUG(D_INFO|D_WARNING, "%s: Input seq range: "
+ DRANGE"\n", seq->lss_name, PRANGE(in));
if (range_is_exhausted(space)) {
- LASSERT(in->lr_start > space->lr_start);
-
/*
* Server cannot send empty range to client, this is why
* we check here that range from client is "newer" than
* exhausted super.
*/
- space->lr_start = in->lr_start;
+ LASSERT(in->lr_end > space->lr_start);
+
+ /*
+ * Start is set to end of last allocated, because it
+ * *is* already allocated so we take that into account
+ * and do not use for other allocations.
+ */
+ space->lr_start = in->lr_end;
- space->lr_end = space->lr_start +
- seq->lss_width;
+ /*
+ * End is set to in->lr_start + super sequence
+ * allocation unit. That is because in->lr_start is
+ * first seq in new allocated range from controller
+ * before failure.
+ */
+ space->lr_end = in->lr_start + LUSTRE_SEQ_SUPER_WIDTH;
} else {
/*
- * Update super start by start from client's range. End
- * should not be changed if range was not exhausted.
+ * Update super start by end from client's range. Super
+ * end should not be changed if range was not exhausted.
*/
- if (in->lr_start > space->lr_start)
- space->lr_start = in->lr_start;
+ if (in->lr_end > space->lr_start)
+ space->lr_start = in->lr_end;
}
*out = *in;
- CDEBUG(D_INFO|D_WARNING, "%s: Recovery finished. Recovered "
- "super: "DRANGE"\n", seq->lss_name, PRANGE(space));
+ CDEBUG(D_INFO|D_WARNING, "%s: Recovered space: "DRANGE"\n",
+ seq->lss_name, PRANGE(space));
} else {
/*
* XXX: Avoid cascading RPCs using kind of async preallocation
*space = seq->lss_cli->lcs_space;
LASSERT(range_is_sane(space));
}
+
range_alloc(out, space, seq->lss_width);
}
rc = -EINVAL;
break;
}
+ if (rc) {
+ CERROR("%s: FLD req (opc: %d, seq: "LPX64", mds: "
+ LPU64") handle error %d\n", fld->lsf_name,
+ opc, mf->mf_seq, mf->mf_mds, rc);
+ }
RETURN(rc);
}
return range_space(r) == 0;
}
-#define DRANGE "[%16.16"LPF64"x-%16.16"LPF64"x]"
+#define DRANGE "[0x%16.16"LPF64"x-0x%16.16"LPF64"x]"
#define PRANGE(range) \
(range)->lr_start, \
*/
enum {
LUSTRE_ROOT_FID_SEQ = 1ULL, /* XXX: should go into mkfs. */
- LUSTRE_ROOT_FID_OID = 2UL, /* XXX: should go into mkfs. */
/* initial fid id value */
LUSTRE_FID_INIT_OID = 1UL
fid_seq_is_sane(fid_seq(fid)) && fid_oid(fid) != 0;
}
-#define DFID "[%16.16"LPF64"x/%8.8x:%8.8x]"
+#define DFID "[0x%16.16"LPF64"x/0x%8.8x:0x%8.8x]"
#define PFID(fid) \
fid_seq(fid), \
obd_force:1, /* cleanup with > 0 obd refcount */
obd_fail:1, /* cleanup with failover */
obd_async_recov:1, /* allow asyncronous orphan cleanup */
- obd_configured:1; /* config llog parsed completely */
+ obd_configured:1; /* llog configuration finished successfully */
atomic_t obd_refcount;
cfs_waitq_t obd_refcount_waitq;
cfs_proc_dir_entry_t *obd_proc_entry;
RETURN(ELDLM_LOCK_REPLACED);
}
-static void mdt_fixup_resent(struct req_capsule *pill,
- struct ldlm_lock *new_lock,
- struct ldlm_lock **old_lock,
- struct mdt_lock_handle *lh)
+static void mdt_intent_fixup_resent(struct req_capsule *pill,
+ struct ldlm_lock *new_lock,
+ struct ldlm_lock **old_lock,
+ struct mdt_lock_handle *lh)
{
struct ptlrpc_request *req = pill->rc_req;
struct obd_export *exp = req->rq_export;
mdt_set_disposition(info, ldlm_rep, DISP_IT_EXECD);
/* Get lock from request for possible resent case. */
- mdt_fixup_resent(&info->mti_pill, *lockp, &new_lock, lhc);
+ mdt_intent_fixup_resent(&info->mti_pill, *lockp, &new_lock, lhc);
ldlm_rep->lock_policy_res2 =
mdt_getattr_name_lock(info, lhc, child_bits, ldlm_rep);
if (mdt_get_disposition(ldlm_rep, DISP_LOOKUP_NEG))
ldlm_rep->lock_policy_res2 = 0;
if (!mdt_get_disposition(ldlm_rep, DISP_LOOKUP_POS) ||
- ldlm_rep->lock_policy_res2) {
+ ldlm_rep->lock_policy_res2) {
+ lhc->mlh_lh.cookie = 0ull;
GOTO(out_ucred, rc = ELDLM_LOCK_ABORTED);
}
}
/* Get lock from request for possible resent case. */
- mdt_fixup_resent(&info->mti_pill, *lockp, NULL, lhc);
+ mdt_intent_fixup_resent(&info->mti_pill, *lockp, NULL, lhc);
rc = mdt_reint_internal(info, lhc, opc);
}
rep->lock_policy_res2 = clear_serious(rc);
+ lhc->mlh_lh.cookie = 0ull;
RETURN(ELDLM_LOCK_ABORTED);
}
(lcfg->lcfg_command != LCFG_MARKER)) {
CWARN("Config not inside markers, ignoring! "
"(inst: %s, uuid: %s, flags: %#x)\n",
- clli->cfg_instance, clli->cfg_uuid.uuid,
- clli->cfg_flags);
+ clli->cfg_instance ? clli->cfg_instance : "<null>",
+ clli->cfg_uuid.uuid, clli->cfg_flags);
clli->cfg_flags |= CFG_F_SKIP;
}
if (clli->cfg_flags & CFG_F_SKIP) {
RETURN(rc);
}
-void class_config_notify_end(const char *name)
+static void class_config_notify_end(const char *name)
{
struct obd_device *obd;
ENTRY;
if (obd)
obd->obd_configured = 1;
else {
- CWARN("OBD \"%s\" is not found - skipped.\n", name);
+ /*
+ * XXX: @name is actually not OBD name, rather log name and it
+ * may not be the same as OBD name for clients. For servers it
+ * is true currently but anyway not reliable. This is why this
+ * it is dirty hack.
+ */
+ CDEBUG(D_CONFIG, "OBD \"%s\" is not found - skipped.\n",
+ name);
}
EXIT;
}
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);
+ CDEBUG(D_CONFIG, "Log %s did not parse successfully, "
+ "OBD is not configured.\n", name);
}
+
if (cfg)
cfg->cfg_last_idx = cd.last_idx;
cat $file
}
+# This test should pass for single-mds and multi-mds configs.
+# But for different configurations it tests different things.
+#
+# single-mds
+# ----------
+# (1) fld_create replay should happen;
+#
+# (2) fld_create replay should not return -EEXISTS, if it does
+# this means sequence manager recovery code is buggy and allocated
+# same sequence two times after recovery.
+#
+# multi-mds
+# ---------
+# (1) fld_create replay may not happen, because its home MDS is
+# MDS2 which is not involved to revovery;
+#
+# (2) as fld_create does not happen on MDS1, it does not may any
+# problem.
test_0c() {
local label=`mdsdevlabel 1`
[ -z "$label" ] && echo "No label for mds1" && return 1