From 07d32e890d45b76f7bab362420969514df14451b Mon Sep 17 00:00:00 2001 From: jxiong Date: Fri, 23 Jan 2009 10:01:55 +0000 Subject: [PATCH] b=17508 r=huanghua,nikita Fixed a minior issue about mdc device. Now (mds) mdc device is not really stacked into mdt device family, so mdc_type_init is not called at all. The hot fix is to call it in cmm_mod_init. --- lustre/cmm/cmm_device.c | 18 ++++++++++++++++-- lustre/obdclass/lu_object.c | 1 + 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/lustre/cmm/cmm_device.c b/lustre/cmm/cmm_device.c index 01f319d..681e2db 100644 --- a/lustre/cmm/cmm_device.c +++ b/lustre/cmm/cmm_device.c @@ -817,15 +817,29 @@ static void lprocfs_cmm_init_vars(struct lprocfs_static_vars *lvars) static int __init cmm_mod_init(void) { struct lprocfs_static_vars lvars; + int rc; + + /* + * Kludge code : it should be moved mdc_device.c if mdc_(mds)_device + * is really stacked. + */ + rc = lu_device_type_init(&mdc_device_type); + if (rc) + return rc; lprocfs_cmm_init_vars(&lvars); - return class_register_type(&cmm_obd_device_ops, NULL, lvars.module_vars, - LUSTRE_CMM_NAME, &cmm_device_type); + rc = class_register_type(&cmm_obd_device_ops, NULL, lvars.module_vars, + LUSTRE_CMM_NAME, &cmm_device_type); + if (rc) + lu_device_type_fini(&mdc_device_type); + + return rc; } static void __exit cmm_mod_exit(void) { class_unregister_type(LUSTRE_CMM_NAME); + lu_device_type_fini(&mdc_device_type); } MODULE_AUTHOR("Sun Microsystems, Inc. "); diff --git a/lustre/obdclass/lu_object.c b/lustre/obdclass/lu_object.c index 5cae3c1..d5f6f5c 100644 --- a/lustre/obdclass/lu_object.c +++ b/lustre/obdclass/lu_object.c @@ -1193,6 +1193,7 @@ void *lu_context_key_get(const struct lu_context *ctx, { LINVRNT(ctx->lc_state == LCS_ENTERED); LINVRNT(0 <= key->lct_index && key->lct_index < ARRAY_SIZE(lu_keys)); + LASSERT(lu_keys[key->lct_index] == key); return ctx->lc_value[key->lct_index]; } EXPORT_SYMBOL(lu_context_key_get); -- 1.8.3.1