From f4752ae4c471ec1bbd10e4f6ae2b59e3f0aa2071 Mon Sep 17 00:00:00 2001 From: yury Date: Thu, 22 Dec 2005 10:59:33 +0000 Subject: [PATCH] - fixed debug message in ldlm_lock_put() to less confusing. Former looked like this: "final lock_put on destroyed lock, freeing namespace ..." whereas it should like this: "final lock_put on destroyed lock, freeing it. namespace ..." - cleanups in mds_init_lov_desc() - in mds_notify() remove obd_set_info("mds_conn") before calling mds_lov_start_synchronize() as it will be called by mds_lov_start_synchronize() itself. - in filter_set_info() using IS_KEY() macro --- lustre/ldlm/ldlm_lock.c | 2 +- lustre/lov/lov_obd.c | 2 +- lustre/mds/mds_lov.c | 14 ++++++-------- lustre/obdfilter/filter.c | 3 +-- 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/lustre/ldlm/ldlm_lock.c b/lustre/ldlm/ldlm_lock.c index 16ea94e..b1c9173 100644 --- a/lustre/ldlm/ldlm_lock.c +++ b/lustre/ldlm/ldlm_lock.c @@ -131,7 +131,7 @@ void ldlm_lock_put(struct ldlm_lock *lock) struct obd_export *export = NULL; l_lock(&ns->ns_lock); - LDLM_DEBUG(lock, "final lock_put on destroyed lock, freeing"); + LDLM_DEBUG(lock, "final lock_put on destroyed lock, freeing it."); LASSERT(lock->l_destroyed); LASSERT(list_empty(&lock->l_res_link)); diff --git a/lustre/lov/lov_obd.c b/lustre/lov/lov_obd.c index b55fe26..9aecee04 100644 --- a/lustre/lov/lov_obd.c +++ b/lustre/lov/lov_obd.c @@ -2202,7 +2202,7 @@ static int lov_set_info(struct obd_export *exp, obd_count keylen, continue; err = obd_set_info(lov->tgts[i].ltd_exp, - keylen, key, vallen, val); + keylen, key, vallen, val); if (!rc) rc = err; } diff --git a/lustre/mds/mds_lov.c b/lustre/mds/mds_lov.c index 6c78bdf..79b1990 100644 --- a/lustre/mds/mds_lov.c +++ b/lustre/mds/mds_lov.c @@ -151,13 +151,16 @@ int mds_init_lov_desc(struct obd_device *obd, struct obd_export *osc_exp) int valsize, rc; ENTRY; + mds->mds_has_lov_desc = 0; valsize = sizeof(mds->mds_lov_desc); rc = obd_get_info(mds->mds_osc_exp, strlen("lovdesc") + 1, "lovdesc", &valsize, &mds->mds_lov_desc); - if (rc) + if (rc) { CERROR("can't get lov_desc, rc %d\n", rc); + RETURN(rc); + } - mds->mds_has_lov_desc = rc ? 0 : 1; + mds->mds_has_lov_desc = 1; if (mds->mds_has_lov_desc) { CDEBUG(D_HA, "updating lov_desc, tgt_count: %d\n", @@ -170,7 +173,7 @@ int mds_init_lov_desc(struct obd_device *obd, struct obd_export *osc_exp) CDEBUG(D_HA, "updating max_mdsize/max_cookiesize: %d/%d\n", mds->mds_max_mdsize, mds->mds_max_cookiesize); } - RETURN(rc); + RETURN(0); } /* update the LOV-OSC knowledge of the last used object id's */ @@ -626,11 +629,6 @@ int mds_notify(struct obd_device *obd, struct obd_device *watched, if (rc) RETURN(rc); - rc = obd_set_info(mds->mds_osc_exp, strlen("mds_conn"), - "mds_conn", 0, uuid); - if (rc != 0) - RETURN(rc); - rc = mds_lov_start_synchronize(obd, uuid, 1); lquota_recovery(quota_interface, obd); } diff --git a/lustre/obdfilter/filter.c b/lustre/obdfilter/filter.c index 4c8ac2d..bc6973b 100644 --- a/lustre/obdfilter/filter.c +++ b/lustre/obdfilter/filter.c @@ -2820,8 +2820,7 @@ static int filter_set_info(struct obd_export *exp, __u32 keylen, RETURN(-EINVAL); } - if (keylen < strlen("mds_conn") || - memcmp(key, "mds_conn", keylen) != 0) + if (!IS_KEY("mds_conn")) RETURN(-EINVAL); CWARN("%s: received MDS connection from %s\n", obd->obd_name, -- 1.8.3.1