From c83b32e9e2958cb8174742d2d4e141240548f9f2 Mon Sep 17 00:00:00 2001 From: tappro Date: Tue, 5 Dec 2006 16:31:54 +0000 Subject: [PATCH] - set server_timeout for mds-mds import --- lustre/cmm/mdc_device.c | 14 ++++++++++++-- lustre/mdc/mdc_request.c | 8 ++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/lustre/cmm/mdc_device.c b/lustre/cmm/mdc_device.c index af9b1b7..a869c93 100644 --- a/lustre/cmm/mdc_device.c +++ b/lustre/cmm/mdc_device.c @@ -58,7 +58,13 @@ static int mdc_obd_update(struct obd_device *host, LASSERT(mc != NULL); CDEBUG(D_CONFIG, "notify %s ev=%d\n", watched->obd_name, ev); - if (ev == OBD_NOTIFY_OCD) { + if (ev == OBD_NOTIFY_ACTIVE) { + CDEBUG(D_INFO|D_WARNING, "Device %s is active now: "LPX64"\n", + watched->obd_name); + } else if (ev == OBD_NOTIFY_INACTIVE) { + CDEBUG(D_INFO|D_WARNING, "Device %s is inactive now: "LPX64"\n", + watched->obd_name); + } else if (ev == OBD_NOTIFY_OCD) { struct obd_connect_data *conn_data = &watched->u.cli.cl_import->imp_connect_data; /* @@ -148,6 +154,8 @@ static int mdc_obd_add(const struct lu_env *env, /* obd notify mechanism */ mdc->obd_upcall.onu_owner = mc; mdc->obd_upcall.onu_upcall = mdc_obd_update; + obd_set_info_async(desc->cl_exp, strlen("mds_conn"), + "mds_conn", 0, NULL, NULL); } } @@ -188,6 +196,8 @@ static int mdc_obd_del(const struct lu_env *env, struct mdc_device *mc, CERROR("Fid fini error %d\n", rc); obd_register_observer(mdc_obd, NULL); + mdc_obd->obd_upcall.onu_owner = NULL; + mdc_obd->obd_upcall.onu_upcall = NULL; rc = obd_disconnect(desc->cl_exp); if (rc) { CERROR("Target %s disconnect error %d\n", @@ -196,7 +206,7 @@ static int mdc_obd_del(const struct lu_env *env, struct mdc_device *mc, class_manual_cleanup(mdc_obd); desc->cl_exp = NULL; - RETURN(rc); + RETURN(0); } static int mdc_process_config(const struct lu_env *env, diff --git a/lustre/mdc/mdc_request.c b/lustre/mdc/mdc_request.c index 84218e7..27bb74f 100644 --- a/lustre/mdc/mdc_request.c +++ b/lustre/mdc/mdc_request.c @@ -1132,6 +1132,14 @@ int mdc_set_info_async(struct obd_export *exp, obd_count keylen, RETURN(0); } + if (KEY_IS("mds_conn")) { + struct obd_import *imp = class_exp2cliimp(exp); + + imp->imp_server_timeout = 1; + CDEBUG(D_OTHER|D_WARNING, "%s: timeout / 2\n", exp->exp_obd->obd_name); + RETURN(0); + } + RETURN(rc); } -- 1.8.3.1