From 324622c05eb58abde07b2e459d870f95d4410cbe Mon Sep 17 00:00:00 2001 From: Johann Lombardi Date: Wed, 30 Jun 2010 10:28:46 +0200 Subject: [PATCH] b=23131 issue OBD_NOTIFY_CREATE event in lov i=nathan i=andrew (mds_lov.c:573:mds_lov_update_desc()) Process entered (obd_class.h:376:obd_get_info()) Process entered (obd_class.h:378:obd_get_info()) obd_get_info: NULL export (obd_class.h:378:obd_get_info()) Process leaving (rc=18446744073709551597 : -19 : ffffffffffffffed) The problem is that mds_lov_connect() calls obd_notify(OBD_NOTIFY_CREATE) *before* obd_connect(...,&mds->mds_lov_exp). Since mds_notify(OBD_NOTIFY_CREATE) requires mds->mds_lov_exp which is not yet initialized, it fails. --- lustre/liblustre/super.c | 4 ---- lustre/llite/llite_lib.c | 4 ---- lustre/lov/lov_obd.c | 7 +++++-- lustre/mds/mds_lov.c | 4 ---- 4 files changed, 5 insertions(+), 14 deletions(-) diff --git a/lustre/liblustre/super.c b/lustre/liblustre/super.c index df74d5b..08d7a48 100644 --- a/lustre/liblustre/super.c +++ b/lustre/liblustre/super.c @@ -2076,10 +2076,6 @@ llu_fsswop_mount(const char *source, obd->obd_upcall.onu_owner = &sbi->ll_lco; obd->obd_upcall.onu_upcall = ll_ocd_update; - /* ask lov to generate OBD_NOTIFY_CREATE events for already registered - * targets */ - obd_notify(obd, NULL, OBD_NOTIFY_CREATE, NULL); - obd_register_lock_cancel_cb(obd, llu_extent_lock_cancel_cb); ocd.ocd_connect_flags = OBD_CONNECT_SRVLOCK | OBD_CONNECT_REQPORTAL | diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index fd5059a..fd7964d 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -412,10 +412,6 @@ static int client_common_fill_super(struct super_block *sb, obd->obd_upcall.onu_upcall = ll_ocd_update; data->ocd_brw_size = PTLRPC_MAX_BRW_PAGES << CFS_PAGE_SHIFT; - /* ask lov to generate OBD_NOTIFY_CREATE events for already registered - * targets */ - obd_notify(obd, NULL, OBD_NOTIFY_CREATE, NULL); - obd_register_lock_cancel_cb(obd, ll_extent_lock_cancel_cb); obd_register_page_removal_cb(obd, ll_page_removal_cb, ll_pin_extent_cb); diff --git a/lustre/lov/lov_obd.c b/lustre/lov/lov_obd.c index 3475197..3850a79 100644 --- a/lustre/lov/lov_obd.c +++ b/lustre/lov/lov_obd.c @@ -389,6 +389,9 @@ static int lov_connect(struct lustre_handle *conn, struct obd_device *obd, *exp = class_conn2export(conn); + /* generate OBD_NOTIFY_CREATE events for already registered targets */ + obd_notify(obd, NULL, OBD_NOTIFY_CREATE, NULL); + /* Why should there ever be more than 1 connect? */ lov->lov_connects++; LASSERT(lov->lov_connects == 1); @@ -675,8 +678,6 @@ static int lov_add_target(struct obd_device *obd, struct obd_uuid *uuidp, CDEBUG(D_CONFIG, "idx=%d ltd_gen=%d ld_tgt_count=%d\n", index, tgt->ltd_gen, lov->desc.ld_tgt_count); - rc = obd_notify(obd, tgt_obd, OBD_NOTIFY_CREATE, &index); - if (lov->lov_connects == 0) { /* lov_connect hasn't been called yet. We'll do the lov_connect_obd on this target when that fn first runs, @@ -684,6 +685,8 @@ static int lov_add_target(struct obd_device *obd, struct obd_uuid *uuidp, RETURN(0); } + rc = obd_notify(obd, tgt_obd, OBD_NOTIFY_CREATE, &index); + obd_getref(obd); rc = lov_connect_obd(obd, index, active, &lov->lov_ocd); diff --git a/lustre/mds/mds_lov.c b/lustre/mds/mds_lov.c index b478bd9..1aefeed3 100644 --- a/lustre/mds/mds_lov.c +++ b/lustre/mds/mds_lov.c @@ -691,10 +691,6 @@ int mds_lov_connect(struct obd_device *obd, char * lov_name) GOTO(error_exit, rc); } - /* ask lov to generate OBD_NOTIFY_CREATE events for already registered - * targets */ - obd_notify(obd->u.mds.mds_lov_obd, NULL, OBD_NOTIFY_CREATE, NULL); - OBD_ALLOC(data, sizeof(*data)); if (data == NULL) RETURN(-ENOMEM); -- 1.8.3.1