From 2c16e55f5676f528ba7f5652532c950b212060d0 Mon Sep 17 00:00:00 2001 From: Fan Yong Date: Fri, 16 Jul 2010 18:48:11 +0400 Subject: [PATCH] b=23244 unhash the new added export when such obd device is stopping unhash the new added export when such obd device is stopping. i=andreas.dilger i=vitaly.fertman --- lustre/obdclass/genops.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lustre/obdclass/genops.c b/lustre/obdclass/genops.c index c8f9298..28d96a6 100644 --- a/lustre/obdclass/genops.c +++ b/lustre/obdclass/genops.c @@ -772,7 +772,7 @@ struct obd_export *class_new_export(struct obd_device *obd, struct obd_uuid *cluuid) { struct obd_export *export; - cfs_hash_t *hash; + cfs_hash_t *hash = NULL; int rc = 0; ENTRY; @@ -828,11 +828,11 @@ struct obd_export *class_new_export(struct obd_device *obd, } } - cfs_hash_putref(hash); - cfs_spin_lock(&obd->obd_dev_lock); - if (obd->obd_stopping) + if (obd->obd_stopping) { + cfs_hash_del(hash, cluuid, &export->exp_uuid_hash); GOTO(exit_unlock, rc = -ENODEV); + } class_incref(obd, "export", export); cfs_list_add(&export->exp_obd_chain, &export->exp_obd->obd_exports); @@ -840,11 +840,14 @@ struct obd_export *class_new_export(struct obd_device *obd, &export->exp_obd->obd_exports_timed); export->exp_obd->obd_num_exports++; cfs_spin_unlock(&obd->obd_dev_lock); + cfs_hash_putref(hash); RETURN(export); exit_unlock: cfs_spin_unlock(&obd->obd_dev_lock); exit_err: + if (hash) + cfs_hash_putref(hash); class_handle_unhash(&export->exp_handle); LASSERT(cfs_hlist_unhashed(&export->exp_uuid_hash)); obd_destroy_export(export); -- 1.8.3.1