From ab0e3a001d62869035cbe179f7228ad6cbeeb24d Mon Sep 17 00:00:00 2001 From: wangdi Date: Fri, 23 Sep 2005 12:57:23 +0000 Subject: [PATCH] Branch: HEAD try tmp patch for failed test41 --- lustre/include/linux/obd_class.h | 1 + lustre/llite/llite_lib.c | 1 + lustre/lov/lov_obd.c | 19 +++++++++++++++---- lustre/mds/mds_lov.c | 2 +- lustre/obdclass/obd_config.c | 7 ++++++- 5 files changed, 24 insertions(+), 6 deletions(-) diff --git a/lustre/include/linux/obd_class.h b/lustre/include/linux/obd_class.h index 3c54d3c..bc14dc2 100644 --- a/lustre/include/linux/obd_class.h +++ b/lustre/include/linux/obd_class.h @@ -90,6 +90,7 @@ struct config_llog_instance { struct obd_uuid cfg_uuid; ptl_nid_t cfg_local_nid; int cfg_flags; + struct obd_export *cfg_exp; }; int class_config_process_llog(struct llog_ctxt *ctxt, char *name, diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index 43655f8..fd1ee50 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -1066,6 +1066,7 @@ int ll_process_config_update(struct ll_sb_info *sbi, int clean) cfg.cfg_uuid = sbi->ll_sb_uuid; cfg.cfg_local_nid = lmd->lmd_local_nid; cfg.cfg_flags |= CFG_MODIFY_UUID_FL; + cfg.cfg_exp = sbi->ll_md_exp; namelen = strlen(profile) + 20; /* -clean-######### */ OBD_ALLOC(name, namelen); if (name == NULL) diff --git a/lustre/lov/lov_obd.c b/lustre/lov/lov_obd.c index 8774a94..bf1e038 100644 --- a/lustre/lov/lov_obd.c +++ b/lustre/lov/lov_obd.c @@ -573,7 +573,8 @@ lov_add_obd(struct obd_device *obd, struct obd_uuid *uuidp, int index, int gen) } static int -lov_del_obd(struct obd_device *obd, struct obd_uuid *uuidp, int index, int gen) +lov_del_obd(struct obd_device *obd, struct obd_uuid *uuidp, int index, int gen, + struct obd_export *md_exp) { struct lov_obd *lov = &obd->u.lov; struct lov_tgt_desc *tgt; @@ -614,6 +615,13 @@ lov_del_obd(struct obd_device *obd, struct obd_uuid *uuidp, int index, int gen) if (rc != 0) CWARN("obd_cancel_unused(osc): %d\n", rc); + if (md_exp) { + rc = obd_cancel_unused(md_exp, NULL, + LDLM_FL_CONFIG_CHANGE, NULL); + if (rc != 0) + CWARN("obd_cancel_unused(md): %d\n", rc); + } + osc_obd = class_exp2obd(tgt->ltd_exp); if (osc_obd) { osc_obd->obd_no_recov = 1; @@ -678,8 +686,10 @@ static int lov_process_config(struct obd_device *obd, obd_count len, void *buf) GOTO(out, rc = -EINVAL); if (cmd == LCFG_LOV_ADD_OBD) rc = lov_add_obd(obd, &obd_uuid, index, gen); - else - rc = lov_del_obd(obd, &obd_uuid, index, gen); + else { + struct obd_export *md_exp = (struct obd_export *)lcfg->lcfg_nal; + rc = lov_del_obd(obd, &obd_uuid, index, gen, md_exp); + } GOTO(out, rc); } default: { @@ -2145,10 +2155,11 @@ static int lov_get_info(struct obd_export *exp, __u32 keylen, /* This can happen if a deleted OST has been replaced * in the lsm by the MDS. */ +#if 0 LDLM_ERROR(data->lock, "lock on inode without such object"); dump_lsm(D_ERROR, data->lsm); portals_debug_dumpstack(NULL); - +#endif RETURN(-ENXIO); } else if (keylen >= strlen("size_to_stripe") && strcmp(key, "size_to_stripe") == 0) { diff --git a/lustre/mds/mds_lov.c b/lustre/mds/mds_lov.c index ddc5958..8bc2991 100644 --- a/lustre/mds/mds_lov.c +++ b/lustre/mds/mds_lov.c @@ -838,7 +838,7 @@ int mds_dt_update_config(struct obd_device *obd, int clean) RETURN(0); cfg.cfg_instance = NULL; cfg.cfg_uuid = mds->mds_dt_uuid; - + cfg.cfg_exp = NULL; namelen = strlen(profile) + 20; /* -clean-######### */ OBD_ALLOC(name, namelen); if (name == NULL) diff --git a/lustre/obdclass/obd_config.c b/lustre/obdclass/obd_config.c index a0b582c..524b9fe 100644 --- a/lustre/obdclass/obd_config.c +++ b/lustre/obdclass/obd_config.c @@ -665,7 +665,12 @@ static int class_config_parse_handler(struct llog_handle * handle, lcfg_new->lcfg_flags = lcfg->lcfg_flags; lcfg_new->lcfg_nid = lcfg->lcfg_nid; lcfg_new->lcfg_nal = lcfg->lcfg_nal; - + if (cfg && (lcfg->lcfg_command == LCFG_LOV_DEL_OBD)) { + if (cfg->cfg_exp) + lcfg_new->lcfg_nal = (unsigned long)cfg->cfg_exp; + else + lcfg_new->lcfg_nal = 0; + } rc = class_process_config(lcfg_new); lustre_cfg_free(lcfg_new); -- 1.8.3.1