From ee4030d399d29c2fe5f219e3c1d02ebc6dbb1cf7 Mon Sep 17 00:00:00 2001 From: shadow Date: Thu, 9 Apr 2009 05:36:17 +0000 Subject: [PATCH] don't allow connect to already connected import Branch HEAD b=16839 i=rread --- lustre/ChangeLog | 6 ++++++ lustre/ldlm/ldlm_lib.c | 10 +++++----- lustre/obdclass/llog_test.c | 13 ++++++------- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/lustre/ChangeLog b/lustre/ChangeLog index ad770af..08d6c14 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog @@ -14,6 +14,12 @@ tbd Sun Microsystems, Inc. * File join has been disabled in this release, refer to Bugzilla 16929. Severity : normal +Frequency : rare, on llog test 6 +Bugzilla : 16839 +Descriptoin: don't allow connect to already connected import +Details : allowing connect to already connected import is hide connecting problem. + +Severity : normal Frequency : rare Bugzilla : 18902 Descriptoin: allow kill process which wait statahead result diff --git a/lustre/ldlm/ldlm_lib.c b/lustre/ldlm/ldlm_lib.c index 0b0e05f..6a1aebe 100644 --- a/lustre/ldlm/ldlm_lib.c +++ b/lustre/ldlm/ldlm_lib.c @@ -400,15 +400,15 @@ int client_connect_import(const struct lu_env *env, *exp = NULL; down_write(&cli->cl_sem); + if (cli->cl_conn_count > 0 ) + GOTO(out_sem, rc = -EALREADY); + rc = class_connect(&conn, obd, cluuid); if (rc) GOTO(out_sem, rc); - - *exp = class_conn2export(&conn); - + cli->cl_conn_count++; - if (cli->cl_conn_count > 1) - GOTO(out_sem, rc); + *exp = class_conn2export(&conn); if (obd->obd_namespace != NULL) CERROR("already have namespace!\n"); diff --git a/lustre/obdclass/llog_test.c b/lustre/obdclass/llog_test.c index ce887c8..9f35232 100644 --- a/lustre/obdclass/llog_test.c +++ b/lustre/obdclass/llog_test.c @@ -517,11 +517,13 @@ static int llog_test_6(struct obd_device *obd, char *name) 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); } - LASSERTF(exp->exp_obd == mgc_obd, "%p - %p - %p\n", exp, exp->exp_obd, mgc_obd); nctxt = llog_get_context(mgc_obd, LLOG_CONFIG_REPL_CTXT); rc = llog_create(nctxt, &llh, NULL, name); @@ -551,9 +553,6 @@ parse_out: if (rc) { CERROR("6: llog_close failed: rc = %d\n", rc); } - CDEBUG(D_INFO, "obd %p - %p - %p - %p\n", - mgc_obd, exp, exp->exp_obd, exp->exp_obd->obd_type); - rc = obd_disconnect(exp); ctxt_release: llog_ctxt_put(ctxt); RETURN(rc); -- 1.8.3.1