struct obd_device *mgc_obd;
struct llog_ctxt *ctxt = llog_get_context(obd, LLOG_TEST_ORIG_CTXT);
struct obd_uuid *mgs_uuid = &ctxt->loc_exp->exp_obd->obd_uuid;
- struct lustre_handle exph = {0, };
struct obd_export *exp;
struct obd_uuid uuid = {"LLOG_TEST6_UUID"};
struct llog_handle *llh = NULL;
GOTO(ctxt_release, rc = -ENOENT);
}
- rc = obd_connect(NULL, &exph, mgc_obd, &uuid,
+ rc = obd_connect(NULL, &exp, mgc_obd, &uuid,
NULL /* obd_connect_data */, NULL);
- if (rc) {
- CERROR("6: failed to connect to MGC: %s\n", mgc_obd->obd_name);
- GOTO(ctxt_release, rc);
+ if (rc != -EALREADY) {
+ CERROR("6: connect on connected MDC (%s) failed to return"
+ " -EALREADY", mgc_obd->obd_name);
+ if (rc == 0)
+ obd_disconnect(exp);
+ GOTO(ctxt_release, rc = -EINVAL);
}
- exp = class_conn2export(&exph);
nctxt = llog_get_context(mgc_obd, LLOG_CONFIG_REPL_CTXT);
rc = llog_create(nctxt, &llh, NULL, name);
if (rc) {
CERROR("6: llog_close failed: rc = %d\n", rc);
}
- rc = obd_disconnect(exp);
ctxt_release:
llog_ctxt_put(ctxt);
RETURN(rc);