summaryrefslogtreecommitdiffstats
path: root/drivers/staging/lustre
diff options
context:
space:
mode:
authorHongchao Zhang <hongchao.zhang@intel.com>2015-03-25 21:53:20 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-03-26 11:10:24 +0100
commit1c8aa54aaf2c74a28a9e427bb27fd1a12fca8536 (patch)
tree8c053bd568c7b4bb25d5a39278479d0206edb04e /drivers/staging/lustre
parent06fbc01a870eea4431ca340642da7bfd4a5a262e (diff)
downloadop-kernel-dev-1c8aa54aaf2c74a28a9e427bb27fd1a12fca8536.zip
op-kernel-dev-1c8aa54aaf2c74a28a9e427bb27fd1a12fca8536.tar.gz
staging/lustre/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. Signed-off-by: Hongchao Zhang <hongchao.zhang@intel.com> Reviewed-on: http://review.whamcloud.com/12896 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5650 Reviewed-by: Fan Yong <fan.yong@intel.com> Reviewed-by: Niu Yawei <yawei.niu@intel.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/lustre')
-rw-r--r--drivers/staging/lustre/lustre/mgc/mgc_request.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/staging/lustre/lustre/mgc/mgc_request.c b/drivers/staging/lustre/lustre/mgc/mgc_request.c
index 0375bfe..3f00e77 100644
--- a/drivers/staging/lustre/lustre/mgc/mgc_request.c
+++ b/drivers/staging/lustre/lustre/mgc/mgc_request.c
@@ -452,10 +452,14 @@ static int config_log_end(char *logname, struct config_llog_instance *cfg)
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 obd_import *imp;
+ struct obd_connect_data *ocd;
struct config_llog_data *cld;
+ 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");
seq_printf(m, "client_state:\n");
@@ -470,6 +474,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
OpenPOWER on IntegriCloud