From: Hongchao Zhang Date: Tue, 9 Sep 2014 12:18:17 +0000 (+0800) Subject: LU-5650 mgc: check the import stat for lprocfs X-Git-Tag: 2.6.91~48 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=refs%2Fchanges%2F27%2F12327%2F2;p=fs%2Flustre-release.git LU-5650 mgc: check the import stat for lprocfs in lprocfs_mgc_rd_ir_state, the import state should be checked the validity before doing further work. Change-Id: Ic582150a1cdbef331a929ce378d6e4f987a169fd Signed-off-by: Hongchao Zhang Reviewed-on: http://review.whamcloud.com/12327 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Fan Yong Reviewed-by: Niu Yawei Reviewed-by: Oleg Drokin --- diff --git a/lustre/mgc/mgc_request.c b/lustre/mgc/mgc_request.c index 66b3329..1788874 100644 --- a/lustre/mgc/mgc_request.c +++ b/lustre/mgc/mgc_request.c @@ -466,11 +466,16 @@ static int config_log_end(char *logname, struct config_llog_instance *cfg) #ifdef LPROCFS int lprocfs_mgc_rd_ir_state(struct seq_file *m, void *data) { - struct obd_device *obd = data; - struct obd_import *imp = obd->u.cli.cl_import; - struct obd_connect_data *ocd = &imp->imp_connect_data; - struct config_llog_data *cld; - ENTRY; + struct obd_device *obd = data; + struct obd_import *imp; + struct obd_connect_data *ocd; + struct config_llog_data *cld; + ENTRY; + + LASSERT(obd != NULL); + LPROCFS_CLIMP_CHECK(obd); + imp = obd->u.cli.cl_import; + ocd = &imp->imp_connect_data; seq_printf(m, "imperative_recovery: %s\n", OCD_HAS_FLAG(ocd, IMP_RECOV) ? "ENABLED" : "DISABLED"); @@ -486,6 +491,7 @@ int lprocfs_mgc_rd_ir_state(struct seq_file *m, void *data) } spin_unlock(&config_list_lock); + LPROCFS_CLIMP_EXIT(obd); RETURN(0); } #endif