From e4a7affffc1bb839c4e13239e4774ea3b2ccb1bb Mon Sep 17 00:00:00 2001 From: James Simmons Date: Mon, 30 Jul 2012 08:03:44 -0400 Subject: [PATCH] LU-1014 mountconf: MGS update timeout upon config update MGS should update obd/ldlm_timeout upon MDS/OST config update. It will be the largest value of all servers. Signed-off-by: James Simmons Signed-off-by: Lai Siyao Change-Id: Ia0786475fa5608e06f8c2606f87f98192a870df5 Reviewed-on: http://review.whamcloud.com/2881 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- lustre/include/obd_support.h | 2 ++ lustre/mgs/mgs_llog.c | 14 ++++++++++++++ lustre/obdclass/class_obd.c | 4 ++++ lustre/obdclass/obd_config.c | 3 ++- 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/lustre/include/obd_support.h b/lustre/include/obd_support.h index bcaa60d..9649e49 100644 --- a/lustre/include/obd_support.h +++ b/lustre/include/obd_support.h @@ -66,6 +66,8 @@ extern unsigned int obd_dump_on_eviction; networking / disk / timings affected by load (use Adaptive Timeouts) */ extern unsigned int obd_timeout; /* seconds */ extern unsigned int ldlm_timeout; /* seconds */ +extern unsigned int obd_timeout_set; +extern unsigned int ldlm_timeout_set; extern unsigned int at_min; extern unsigned int at_max; extern unsigned int at_history; diff --git a/lustre/mgs/mgs_llog.c b/lustre/mgs/mgs_llog.c index a710617..00518d2 100644 --- a/lustre/mgs/mgs_llog.c +++ b/lustre/mgs/mgs_llog.c @@ -2045,6 +2045,20 @@ static int mgs_write_log_sys(struct obd_device *obd, struct fs_db *fsdb, rc = mgs_write_log_direct_all(obd, fsdb, mti, *tmp == '\0' ? NULL : lcfg, mti->mti_fsname, sys); + if (rc == 0 && *tmp != '\0') { + switch (cmd) { + case LCFG_SET_TIMEOUT: + if (!obd_timeout_set || lcfg->lcfg_num > obd_timeout) + class_process_config(lcfg); + break; + case LCFG_SET_LDLM_TIMEOUT: + if (!ldlm_timeout_set || lcfg->lcfg_num > ldlm_timeout) + class_process_config(lcfg); + break; + default: + break; + } + } *ptr = sep; lustre_cfg_free(lcfg); return rc; diff --git a/lustre/obdclass/class_obd.c b/lustre/obdclass/class_obd.c index 6689678..01996a0 100644 --- a/lustre/obdclass/class_obd.c +++ b/lustre/obdclass/class_obd.c @@ -82,6 +82,10 @@ unsigned int obd_timeout = OBD_TIMEOUT_DEFAULT; /* seconds */ EXPORT_SYMBOL(obd_timeout); unsigned int ldlm_timeout = LDLM_TIMEOUT_DEFAULT; /* seconds */ EXPORT_SYMBOL(ldlm_timeout); +unsigned int obd_timeout_set; +EXPORT_SYMBOL(obd_timeout_set); +unsigned int ldlm_timeout_set; +EXPORT_SYMBOL(ldlm_timeout_set); /* Adaptive timeout defs here instead of ptlrpc module for /proc/sys/ access */ unsigned int at_min = 0; EXPORT_SYMBOL(at_min); diff --git a/lustre/obdclass/obd_config.c b/lustre/obdclass/obd_config.c index f67bc3a..e7222da 100644 --- a/lustre/obdclass/obd_config.c +++ b/lustre/obdclass/obd_config.c @@ -1054,6 +1054,7 @@ int class_process_config(struct lustre_cfg *lcfg) CDEBUG(D_IOCTL, "changing lustre timeout from %d to %d\n", obd_timeout, lcfg->lcfg_num); obd_timeout = max(lcfg->lcfg_num, 1U); + obd_timeout_set = 1; GOTO(out, err = 0); } case LCFG_SET_LDLM_TIMEOUT: { @@ -1062,7 +1063,7 @@ int class_process_config(struct lustre_cfg *lcfg) ldlm_timeout = max(lcfg->lcfg_num, 1U); if (ldlm_timeout >= obd_timeout) ldlm_timeout = max(obd_timeout / 3, 1U); - + ldlm_timeout_set = 1; GOTO(out, err = 0); } case LCFG_SET_UPCALL: { -- 1.8.3.1