From 2deb4f149f4601f9128fd39efd4705573520f277 Mon Sep 17 00:00:00 2001 From: Wang Di Date: Wed, 21 Apr 2010 11:42:20 -0700 Subject: [PATCH] b=21379 Fix orphans proceeding in osc_create in "osc_create", there is no need to proceed after the orphans are deleted, which cause the oscc->oscc_next_id is increased by 1 and break the balance between it and the last objid stored in "mds->mds_lov_page_array" o=Zhang Hongchao i=Johann I=Tappro --- lustre/include/obd.h | 5 ++-- lustre/lov/lov_obd.c | 13 +++++++++ lustre/mdd/mdd_device.c | 6 ++-- lustre/mdd/mdd_lov.c | 20 ++++++------- lustre/mds/handler.c | 12 ++++---- lustre/mds/lproc_mds.c | 2 +- lustre/mds/mds_log.c | 20 ++++++------- lustre/mds/mds_lov.c | 71 ++++++++++++++++++++++++++------------------- lustre/osc/osc_create.c | 3 +- lustre/quota/lproc_quota.c | 2 +- lustre/quota/quota_master.c | 20 ++++++------- lustre/tests/replay-dual.sh | 18 ++++++++---- 12 files changed, 112 insertions(+), 80 deletions(-) diff --git a/lustre/include/obd.h b/lustre/include/obd.h index 9b3c538..c1c0495 100644 --- a/lustre/include/obd.h +++ b/lustre/include/obd.h @@ -514,10 +514,10 @@ struct mds_obd { cfs_dentry_t *mds_logs_dir; cfs_dentry_t *mds_objects_dir; struct llog_handle *mds_cfg_llh; - struct obd_device *mds_osc_obd; /* XXX lov_obd */ + struct obd_device *mds_lov_obd; struct obd_uuid mds_lov_uuid; char *mds_profile; - struct obd_export *mds_osc_exp; /* XXX lov_exp */ + struct obd_export *mds_lov_exp; struct lov_desc mds_lov_desc; __u32 mds_id; @@ -1172,6 +1172,7 @@ enum obd_cleanup_stage { #define KEY_SET_FS "set_fs" /* KEY_SET_INFO in lustre_idl.h */ #define KEY_SPTLRPC_CONF "sptlrpc_conf" +#define KEY_CONNECT_FLAG "connect_flags" struct lu_context; diff --git a/lustre/lov/lov_obd.c b/lustre/lov/lov_obd.c index 53a0343..1174f2f 100644 --- a/lustre/lov/lov_obd.c +++ b/lustre/lov/lov_obd.c @@ -2579,6 +2579,19 @@ static int lov_get_info(struct obd_export *exp, __u32 keylen, } else if (KEY_IS(KEY_FIEMAP)) { rc = lov_fiemap(lov, keylen, key, vallen, val, lsm); GOTO(out, rc); + } else if (KEY_IS(KEY_CONNECT_FLAG)) { + struct lov_tgt_desc *tgt; + __u64 ost_idx = *((__u64*)val); + + LASSERT(*vallen == sizeof(__u64)); + LASSERT(ost_idx < lov->desc.ld_tgt_count); + tgt = lov->lov_tgts[ost_idx]; + + if (!tgt || !tgt->ltd_exp) + GOTO(out, rc = -ESRCH); + + *((__u64*)val) = tgt->ltd_exp->exp_connect_flags; + GOTO(out, rc = 0); } rc = -EINVAL; diff --git a/lustre/mdd/mdd_device.c b/lustre/mdd/mdd_device.c index b178527..2618a7e 100644 --- a/lustre/mdd/mdd_device.c +++ b/lustre/mdd/mdd_device.c @@ -1010,7 +1010,7 @@ static int mdd_lov_set_nextid(const struct lu_env *env, ENTRY; LASSERT(mds->mds_lov_objids != NULL); - rc = obd_set_info_async(mds->mds_osc_exp, strlen(KEY_NEXT_ID), + rc = obd_set_info_async(mds->mds_lov_exp, strlen(KEY_NEXT_ID), KEY_NEXT_ID, mds->mds_lov_desc.ld_tgt_count, mds->mds_lov_objids, NULL); @@ -1054,7 +1054,7 @@ static int mdd_recovery_complete(const struct lu_env *env, } #endif /* Call that with obd_recovering = 1 just to update objids */ - obd_notify(obd->u.mds.mds_osc_obd, NULL, (obd->obd_async_recov ? + obd_notify(obd->u.mds.mds_lov_obd, NULL, (obd->obd_async_recov ? OBD_NOTIFY_SYNC_NONBLOCK : OBD_NOTIFY_SYNC), NULL); /* Drop obd_recovering to 0 and call o_postrecov to recover mds_lov */ @@ -1181,7 +1181,7 @@ static int mdd_update_capa_key(const struct lu_env *env, { struct mds_capa_info info = { .uuid = NULL, .capa = key }; struct mdd_device *mdd = lu2mdd_dev(&m->md_lu_dev); - struct obd_export *lov_exp = mdd2obd_dev(mdd)->u.mds.mds_osc_exp; + struct obd_export *lov_exp = mdd2obd_dev(mdd)->u.mds.mds_lov_exp; int rc; ENTRY; diff --git a/lustre/mdd/mdd_lov.c b/lustre/mdd/mdd_lov.c index 2b9535f..f6514f0 100644 --- a/lustre/mdd/mdd_lov.c +++ b/lustre/mdd/mdd_lov.c @@ -239,7 +239,7 @@ static int mdd_lov_set_stripe_md(const struct lu_env *env, { struct mdd_device *mdd = mdo2mdd(&obj->mod_obj); struct obd_device *obd = mdd2obd_dev(mdd); - struct obd_export *lov_exp = obd->u.mds.mds_osc_exp; + struct obd_export *lov_exp = obd->u.mds.mds_lov_exp; struct lov_stripe_md *lsm = NULL; int rc; ENTRY; @@ -390,7 +390,7 @@ int mdd_lov_create(const struct lu_env *env, struct mdd_device *mdd, const struct md_op_spec *spec, struct lu_attr *la) { struct obd_device *obd = mdd2obd_dev(mdd); - struct obd_export *lov_exp = obd->u.mds.mds_osc_exp; + struct obd_export *lov_exp = obd->u.mds.mds_lov_exp; struct lu_site *site = mdd2lu_dev(mdd)->ld_site; struct obdo *oa; struct lov_stripe_md *lsm = NULL; @@ -568,7 +568,7 @@ int mdd_lovobj_unlink(const struct lu_env *env, struct mdd_device *mdd, int log_unlink) { struct obd_device *obd = mdd2obd_dev(mdd); - struct obd_export *lov_exp = obd->u.mds.mds_osc_exp; + struct obd_export *lov_exp = obd->u.mds.mds_lov_exp; struct lov_stripe_md *lsm = NULL; struct obd_trans_info *oti = &mdd_env_info(env)->mti_oti; struct obdo *oa = &mdd_env_info(env)->mti_oa; @@ -691,10 +691,10 @@ int mdd_log_op_setattr(struct obd_device *obd, __u32 uid, __u32 gid, int rc; ENTRY; - if (IS_ERR(mds->mds_osc_obd)) - RETURN(PTR_ERR(mds->mds_osc_obd)); + if (IS_ERR(mds->mds_lov_obd)) + RETURN(PTR_ERR(mds->mds_lov_obd)); - rc = obd_unpackmd(mds->mds_osc_exp, &lsm, lmm, lmm_size); + rc = obd_unpackmd(mds->mds_lov_exp, &lsm, lmm, lmm_size); if (rc < 0) RETURN(rc); @@ -717,7 +717,7 @@ int mdd_log_op_setattr(struct obd_device *obd, __u32 uid, __u32 gid, OBD_FREE(lsr, sizeof(*lsr)); out: - obd_free_memmd(mds->mds_osc_exp, &lsm); + obd_free_memmd(mds->mds_lov_exp, &lsm); RETURN(rc); } @@ -762,7 +762,7 @@ static int mdd_osc_setattr_async(struct obd_device *obd, __u32 uid, __u32 gid, LASSERT(lmm); - rc = obd_unpackmd(mds->mds_osc_exp, &oinfo.oi_md, lmm, lmm_size); + rc = obd_unpackmd(mds->mds_lov_exp, &oinfo.oi_md, lmm, lmm_size); if (rc < 0) { CERROR("Error unpack md %p for inode "LPU64"\n", lmm, id); GOTO(out, rc); @@ -786,13 +786,13 @@ static int mdd_osc_setattr_async(struct obd_device *obd, __u32 uid, __u32 gid, oinfo.oi_capa = oc; /* do async setattr from mds to ost not waiting for responses. */ - rc = obd_setattr_async(mds->mds_osc_exp, &oinfo, &oti, NULL); + rc = obd_setattr_async(mds->mds_lov_exp, &oinfo, &oti, NULL); if (rc) CDEBUG(D_INODE, "mds to ost setattr objid 0x"LPX64 " on ost error %d\n", oinfo.oi_md->lsm_object_id, rc); out: if (oinfo.oi_md) - obd_free_memmd(mds->mds_osc_exp, &oinfo.oi_md); + obd_free_memmd(mds->mds_lov_exp, &oinfo.oi_md); OBDO_FREE(oinfo.oi_oa); RETURN(rc); } diff --git a/lustre/mds/handler.c b/lustre/mds/handler.c index 146548e..44dcd03 100644 --- a/lustre/mds/handler.c +++ b/lustre/mds/handler.c @@ -149,7 +149,7 @@ static int mds_lov_presetup (struct mds_obd *mds, struct lustre_cfg *lcfg) static int mds_lov_clean(struct obd_device *obd) { struct mds_obd *mds = &obd->u.mds; - struct obd_device *osc = mds->mds_osc_obd; + struct obd_device *osc = mds->mds_lov_obd; ENTRY; if (mds->mds_profile) { @@ -171,7 +171,7 @@ static int mds_lov_clean(struct obd_device *obd) osc->obd_fail = obd->obd_fail; /* Cleanup the lov */ - obd_disconnect(mds->mds_osc_exp); + obd_disconnect(mds->mds_lov_exp); class_manual_cleanup(osc); RETURN(0); @@ -247,7 +247,7 @@ int mds_postrecov(struct obd_device *obd) /* Notify the LOV, which will in turn call mds_notify for each tgt */ /* This means that we have to hack obd_notify to think we're obd_set_up during mds_lov_connect. */ - obd_notify(obd->u.mds.mds_osc_obd, NULL, + obd_notify(obd->u.mds.mds_lov_obd, NULL, obd->obd_async_recov ? OBD_NOTIFY_SYNC_NONBLOCK : OBD_NOTIFY_SYNC, NULL); @@ -258,7 +258,7 @@ int mds_postrecov(struct obd_device *obd) static int mds_lov_early_clean(struct obd_device *obd) { struct mds_obd *mds = &obd->u.mds; - struct obd_device *osc = mds->mds_osc_obd; + struct obd_device *osc = mds->mds_lov_obd; if (!osc || (!obd->obd_force && !obd->obd_fail)) return(0); @@ -289,7 +289,7 @@ static int mds_precleanup(struct obd_device *obd, enum obd_cleanup_stage stage) if (ctxt) llog_cleanup(ctxt); rc = obd_llog_finish(obd, 0); - mds->mds_osc_exp = NULL; + mds->mds_lov_exp = NULL; cfs_up_write(&mds->mds_notify_lock); break; } @@ -430,7 +430,7 @@ static int mds_cmd_cleanup(struct obd_device *obd) int rc = 0; ENTRY; - mds->mds_osc_exp = NULL; + mds->mds_lov_exp = NULL; if (obd->obd_fail) LCONSOLE_WARN("%s: shutting down for failover; client state " diff --git a/lustre/mds/lproc_mds.c b/lustre/mds/lproc_mds.c index a33f9bc..5504ea1 100644 --- a/lustre/mds/lproc_mds.c +++ b/lustre/mds/lproc_mds.c @@ -99,7 +99,7 @@ static int lprocfs_mds_wr_evict_client(struct file *file, const char *buffer, return -ENOMEM; if (obd->u.mds.mds_evict_ost_nids) { - rc = obd_set_info_async(mds->mds_osc_exp, + rc = obd_set_info_async(mds->mds_lov_exp, sizeof(KEY_EVICT_BY_NID), KEY_EVICT_BY_NID, strlen(tmpbuf + 4) + 1, tmpbuf + 4, set); diff --git a/lustre/mds/mds_log.c b/lustre/mds/mds_log.c index 582531e..d14fc08 100644 --- a/lustre/mds/mds_log.c +++ b/lustre/mds/mds_log.c @@ -60,7 +60,7 @@ static int mds_llog_origin_add(struct llog_ctxt *ctxt, struct llog_rec_hdr *rec, struct llog_cookie *logcookies, int numcookies) { struct obd_device *obd = ctxt->loc_obd; - struct obd_device *lov_obd = obd->u.mds.mds_osc_obd; + struct obd_device *lov_obd = obd->u.mds.mds_lov_obd; struct llog_ctxt *lctxt; int rc; ENTRY; @@ -78,7 +78,7 @@ static int mds_llog_origin_connect(struct llog_ctxt *ctxt, struct obd_uuid *uuid) { struct obd_device *obd = ctxt->loc_obd; - struct obd_device *lov_obd = obd->u.mds.mds_osc_obd; + struct obd_device *lov_obd = obd->u.mds.mds_lov_obd; struct llog_ctxt *lctxt; int rc; ENTRY; @@ -98,7 +98,7 @@ static int mds_llog_repl_cancel(struct llog_ctxt *ctxt, struct lov_stripe_md *ls int count, struct llog_cookie *cookies, int flags) { struct obd_device *obd = ctxt->loc_obd; - struct obd_device *lov_obd = obd->u.mds.mds_osc_obd; + struct obd_device *lov_obd = obd->u.mds.mds_lov_obd; struct llog_ctxt *lctxt; int rc; ENTRY; @@ -198,7 +198,7 @@ EXPORT_SYMBOL(mds_changelog_llog_init); int mds_llog_init(struct obd_device *obd, struct obd_llog_group *olg, struct obd_device *disk_obd, int *index) { - struct obd_device *lov_obd = obd->u.mds.mds_osc_obd; + struct obd_device *lov_obd = obd->u.mds.mds_lov_obd; struct llog_ctxt *ctxt; int rc; ENTRY; @@ -296,15 +296,15 @@ int mds_log_op_unlink(struct obd_device *obd, int rc; ENTRY; - if (IS_ERR(mds->mds_osc_obd)) - RETURN(PTR_ERR(mds->mds_osc_obd)); + if (IS_ERR(mds->mds_lov_obd)) + RETURN(PTR_ERR(mds->mds_lov_obd)); - rc = obd_unpackmd(mds->mds_osc_exp, &lsm, lmm, lmm_size); + rc = obd_unpackmd(mds->mds_lov_exp, &lsm, lmm, lmm_size); if (rc < 0) RETURN(rc); rc = mds_llog_add_unlink(obd, lsm, 0, logcookies, cookies_size / sizeof(struct llog_cookie)); - obd_free_memmd(mds->mds_osc_exp, &lsm); + obd_free_memmd(mds->mds_lov_exp, &lsm); RETURN(rc); } EXPORT_SYMBOL(mds_log_op_unlink); @@ -317,8 +317,8 @@ int mds_log_op_orphan(struct obd_device *obd, struct lov_stripe_md *lsm, int rc; ENTRY; - if (IS_ERR(mds->mds_osc_obd)) - RETURN(PTR_ERR(mds->mds_osc_obd)); + if (IS_ERR(mds->mds_lov_obd)) + RETURN(PTR_ERR(mds->mds_lov_obd)); rc = mds_llog_add_unlink(obd, lsm, count - 1, &logcookie, 1); RETURN(rc); diff --git a/lustre/mds/mds_lov.c b/lustre/mds/mds_lov.c index 0572938..aa39938 100644 --- a/lustre/mds/mds_lov.c +++ b/lustre/mds/mds_lov.c @@ -271,7 +271,7 @@ static int mds_log_lost_precreated(struct obd_device *obd, ENTRY; if (*lsmp == NULL) { - rc = obd_alloc_memmd(obd->u.mds.mds_osc_exp, &lsm); + rc = obd_alloc_memmd(obd->u.mds.mds_lov_exp, &lsm); if (rc < 0) RETURN(rc); /* need only one stripe, save old value */ @@ -346,7 +346,7 @@ void mds_lov_update_objids(struct obd_device *obd, struct lov_mds_md *lmm) if (lsm) { /* restore stripes number */ lsm->lsm_stripe_count = stripes; - obd_free_memmd(mds->mds_osc_exp, &lsm); + obd_free_memmd(mds->mds_lov_exp, &lsm); } EXIT; return; @@ -479,24 +479,35 @@ static int mds_lov_get_objid(struct obd_device * obd, obd_id idx) { struct mds_obd *mds = &obd->u.mds; + struct obd_export *lov_exp = mds->mds_lov_exp; unsigned int page; unsigned int off; obd_id *data; + __u64 connect_flags; + __u32 size; int rc = 0; ENTRY; page = idx / OBJID_PER_PAGE(); off = idx % OBJID_PER_PAGE(); data = mds->mds_lov_page_array[page]; - if (data[off] < 2) { + + size = sizeof(__u64); + connect_flags = idx; + rc = obd_get_info(lov_exp, sizeof(KEY_CONNECT_FLAG), KEY_CONNECT_FLAG, + &size, &connect_flags, NULL); + if (rc) + GOTO(out, rc); + + if (data[off] < 2 || connect_flags & OBD_CONNECT_SKIP_ORPHAN) { /* We never read this lastid; ask the osc */ struct obd_id_info lastid; - __u32 size = sizeof(lastid); + size = sizeof(lastid); lastid.idx = idx; lastid.data = &data[off]; - rc = obd_get_info(mds->mds_osc_exp, sizeof(KEY_LAST_ID), - KEY_LAST_ID, &size, &lastid, NULL); + rc = obd_get_info(lov_exp, sizeof(KEY_LAST_ID), KEY_LAST_ID, + &size, &lastid, NULL); if (rc) GOTO(out, rc); @@ -532,7 +543,7 @@ int mds_lov_clear_orphans(struct mds_obd *mds, struct obd_uuid *ost_uuid) if (ost_uuid != NULL) oti.oti_ost_uuid = ost_uuid; - rc = obd_create(mds->mds_osc_exp, &oa, &empty_ea, &oti); + rc = obd_create(mds->mds_lov_exp, &oa, &empty_ea, &oti); RETURN(rc); } @@ -549,7 +560,7 @@ static int mds_lov_set_one_nextid(struct obd_device *obd, __u32 idx, obd_id *id) info.idx = idx; info.data = id; - rc = obd_set_info_async(mds->mds_osc_exp, sizeof(KEY_NEXT_ID), + rc = obd_set_info_async(mds->mds_lov_exp, sizeof(KEY_NEXT_ID), KEY_NEXT_ID, sizeof(info), &info, NULL); if (rc) CERROR ("%s: mds_lov_set_nextid failed (%d)\n", @@ -572,7 +583,7 @@ static int mds_lov_update_desc(struct obd_device *obd, int idx, if (!ld) RETURN(-ENOMEM); - rc = obd_get_info(mds->mds_osc_exp, sizeof(KEY_LOVDESC), KEY_LOVDESC, + rc = obd_get_info(mds->mds_lov_exp, sizeof(KEY_LOVDESC), KEY_LOVDESC, &valsize, ld, NULL); if (rc) GOTO(out, rc); @@ -671,16 +682,16 @@ int mds_lov_connect(struct obd_device *obd, char * lov_name) int rc; ENTRY; - if (IS_ERR(mds->mds_osc_obd)) - RETURN(PTR_ERR(mds->mds_osc_obd)); + if (IS_ERR(mds->mds_lov_obd)) + RETURN(PTR_ERR(mds->mds_lov_obd)); - if (mds->mds_osc_obd) + if (mds->mds_lov_obd) RETURN(0); - mds->mds_osc_obd = class_name2obd(lov_name); - if (!mds->mds_osc_obd) { + mds->mds_lov_obd = class_name2obd(lov_name); + if (!mds->mds_lov_obd) { CERROR("MDS cannot locate LOV %s\n", lov_name); - mds->mds_osc_obd = ERR_PTR(-ENOTCONN); + mds->mds_lov_obd = ERR_PTR(-ENOTCONN); RETURN(-ENOTCONN); } @@ -692,7 +703,7 @@ int mds_lov_connect(struct obd_device *obd, char * lov_name) GOTO(err_exit, rc); } - rc = obd_register_observer(mds->mds_osc_obd, obd); + rc = obd_register_observer(mds->mds_lov_obd, obd); if (rc) { CERROR("MDS cannot register as observer of LOV %s (%d)\n", lov_name, rc); @@ -704,7 +715,7 @@ int mds_lov_connect(struct obd_device *obd, char * lov_name) if (rc) GOTO(err_exit, rc); - mds->mds_osc_obd->u.lov.lov_sp_me = LUSTRE_SP_MDT; + mds->mds_lov_obd->u.lov.lov_sp_me = LUSTRE_SP_MDT; OBD_ALLOC(data, sizeof(*data)); if (data == NULL) @@ -727,11 +738,11 @@ int mds_lov_connect(struct obd_device *obd, char * lov_name) /* send the list of supported checksum types */ data->ocd_cksum_types = OBD_CKSUM_ALL; /* NB: lov_connect() needs to fill in .ocd_index for each OST */ - rc = obd_connect(NULL, &mds->mds_osc_exp, mds->mds_osc_obd, &obd->obd_uuid, data, NULL); + rc = obd_connect(NULL, &mds->mds_lov_exp, mds->mds_lov_obd, &obd->obd_uuid, data, NULL); OBD_FREE(data, sizeof(*data)); if (rc) { CERROR("MDS cannot connect to LOV %s (%d)\n", lov_name, rc); - mds->mds_osc_obd = ERR_PTR(rc); + mds->mds_lov_obd = ERR_PTR(rc); RETURN(rc); } @@ -747,8 +758,8 @@ int mds_lov_connect(struct obd_device *obd, char * lov_name) RETURN(rc); err_exit: - mds->mds_osc_exp = NULL; - mds->mds_osc_obd = ERR_PTR(rc); + mds->mds_lov_exp = NULL; + mds->mds_lov_obd = ERR_PTR(rc); RETURN(rc); } @@ -758,16 +769,16 @@ int mds_lov_disconnect(struct obd_device *obd) int rc = 0; ENTRY; - if (!IS_ERR(mds->mds_osc_obd) && mds->mds_osc_exp != NULL) { - obd_register_observer(mds->mds_osc_obd, NULL); + if (!IS_ERR(mds->mds_lov_obd) && mds->mds_lov_exp != NULL) { + obd_register_observer(mds->mds_lov_obd, NULL); /* The actual disconnect of the mds_lov will be called from * class_disconnect_exports from mds_lov_clean. So we have to * ensure that class_cleanup doesn't fail due to the extra ref * we're holding now. The mechanism to do that already exists - * the obd_force flag. We'll drop the final ref to the - * mds_osc_exp in mds_cleanup. */ - mds->mds_osc_obd->obd_force = 1; + * mds_lov_exp in mds_cleanup. */ + mds->mds_lov_obd->obd_force = 1; } RETURN(rc); @@ -797,7 +808,7 @@ static int mds_propagate_capa_keys(struct mds_obd *mds, struct obd_uuid *uuid) DEBUG_CAPA_KEY(D_SEC, key, "propagate"); info.capa = key; - rc = obd_set_info_async(mds->mds_osc_exp, sizeof(KEY_CAPA_KEY), + rc = obd_set_info_async(mds->mds_lov_exp, sizeof(KEY_CAPA_KEY), KEY_CAPA_KEY, sizeof(info), &info, NULL); if (rc) { DEBUG_CAPA_KEY(D_ERROR, key, @@ -848,7 +859,7 @@ static int __mds_lov_synchronize(void *data) mgi.group = mdt_to_obd_objgrp(mds->mds_id); mgi.uuid = uuid; - rc = obd_set_info_async(mds->mds_osc_exp, sizeof(KEY_MDS_CONN), + rc = obd_set_info_async(mds->mds_lov_exp, sizeof(KEY_MDS_CONN), KEY_MDS_CONN, sizeof(mgi), &mgi, NULL); if (rc != 0) GOTO(out, rc); @@ -897,9 +908,9 @@ out: /* Deactivate it for safety */ CERROR("%s sync failed %d, deactivating\n", obd_uuid2str(uuid), rc); - if (!obd->obd_stopping && mds->mds_osc_obd && - !mds->mds_osc_obd->obd_stopping && !watched->obd_stopping) - obd_notify(mds->mds_osc_obd, watched, + if (!obd->obd_stopping && mds->mds_lov_obd && + !mds->mds_lov_obd->obd_stopping && !watched->obd_stopping) + obd_notify(mds->mds_lov_obd, watched, OBD_NOTIFY_INACTIVE, NULL); } diff --git a/lustre/osc/osc_create.c b/lustre/osc/osc_create.c index cbe8d5d..4cee7c6 100644 --- a/lustre/osc/osc_create.c +++ b/lustre/osc/osc_create.c @@ -587,8 +587,7 @@ int osc_create(struct obd_export *exp, struct obdo *oa, cfs_waitq_signal(&oscc->oscc_waitq); cfs_spin_unlock(&oscc->oscc_lock); - if (rc < 0) - RETURN(rc); + RETURN(rc); } lsm = *ea; diff --git a/lustre/quota/lproc_quota.c b/lustre/quota/lproc_quota.c index 6f0114a..b42e25a 100644 --- a/lustre/quota/lproc_quota.c +++ b/lustre/quota/lproc_quota.c @@ -253,7 +253,7 @@ int generic_quota_on(struct obd_device *obd, struct obd_quotactl *oqctl, int glo } if (rc == 0 && global && is_master) - rc = obd_quotactl(obd->u.mds.mds_osc_exp, oqctl); + rc = obd_quotactl(obd->u.mds.mds_lov_exp, oqctl); } if (is_master) diff --git a/lustre/quota/quota_master.c b/lustre/quota/quota_master.c index c72e477..3563a78 100644 --- a/lustre/quota/quota_master.c +++ b/lustre/quota/quota_master.c @@ -322,7 +322,7 @@ int dqacq_adjust_qunit_sz(struct obd_device *obd, qid_t id, int type, /* only when block qunit is reduced, boardcast to osts */ if ((adjust_res & LQS_BLK_DECREASE) && QAQ_IS_ADJBLK(oqaq)) - rc = obd_quota_adjust_qunit(mds->mds_osc_exp, oqaq, qctxt); + rc = obd_quota_adjust_qunit(mds->mds_lov_exp, oqaq, qctxt); out: lustre_dqput(dquot); @@ -653,7 +653,7 @@ int mds_quota_finvalidate(struct obd_device *obd, struct obd_quotactl *oqctl) oqctl->qc_cmd = Q_FINVALIDATE; rc = fsfilt_quotactl(obd, obd->u.obt.obt_sb, oqctl); if (!rc) - rc = obd_quotactl(mds->mds_osc_exp, oqctl); + rc = obd_quotactl(mds->mds_lov_exp, oqctl); cfs_up(&mds->mds_qonoff_sem); pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL); @@ -893,7 +893,7 @@ int do_mds_quota_off(struct obd_device *obd, struct obd_quotactl *oqctl) GOTO(out, rc1); } - rc = obd_quotactl(mds->mds_osc_exp, oqctl); + rc = obd_quotactl(mds->mds_lov_exp, oqctl); if (rc && rc != -EALREADY) { CWARN("mds remote quota[%d] is failed to be off for %d\n", oqctl->qc_type, rc); @@ -1221,7 +1221,7 @@ static int mds_init_slave_blimits(struct obd_device *obd, id[GRPQUOTA] = oqctl->qc_id; /* initialize all slave's limit */ - rc = obd_quotactl(mds->mds_osc_exp, ioqc); + rc = obd_quotactl(mds->mds_lov_exp, ioqc); rc = qctxt_adjust_qunit(obd, &obd->u.obt.obt_qctxt, id, 1, 0, NULL); if (rc == -EDQUOT || rc == -EBUSY) { @@ -1252,7 +1252,7 @@ static void adjust_lqs(struct obd_device *obd, struct quota_adjust_qunit *qaq) /* adjust remote lqs */ if (QAQ_IS_ADJBLK(qaq)) { - rc = obd_quota_adjust_qunit(obd->u.mds.mds_osc_exp, qaq, qctxt); + rc = obd_quota_adjust_qunit(obd->u.mds.mds_lov_exp, qaq, qctxt); if (rc < 0) CERROR("adjust slaves' qunit size failed!(rc=%d)\n", rc); @@ -1263,7 +1263,7 @@ int mds_set_dqblk(struct obd_device *obd, struct obd_quotactl *oqctl) { struct mds_obd *mds = &obd->u.mds; struct lustre_quota_ctxt *qctxt = &mds->mds_obt.obt_qctxt; - struct obd_device *lov_obd = class_exp2obd(mds->mds_osc_exp); + struct obd_device *lov_obd = class_exp2obd(mds->mds_lov_exp); struct lov_obd *lov = &lov_obd->u.lov; struct quota_adjust_qunit *oqaq = NULL; struct lustre_quota_info *qinfo = &mds->mds_quota_info; @@ -1450,7 +1450,7 @@ static int mds_get_space(struct obd_device *obd, struct obd_quotactl *oqctl) /* get block usage from OSS */ soqc->qc_dqblk.dqb_curspace = 0; - rc = obd_quotactl(obd->u.mds.mds_osc_exp, soqc); + rc = obd_quotactl(obd->u.mds.mds_lov_exp, soqc); if (!rc || rc == -EREMOTEIO) { oqctl->qc_dqblk.dqb_curspace = soqc->qc_dqblk.dqb_curspace; oqctl->qc_dqblk.dqb_valid |= QIF_SPACE; @@ -1574,7 +1574,7 @@ dquot_recovery(struct obd_device *obd, unsigned int id, unsigned short type) qctl->qc_type = type; qctl->qc_id = id; qctl->qc_stat = QUOTA_RECOVERING; - rc = obd_quotactl(mds->mds_osc_exp, qctl); + rc = obd_quotactl(mds->mds_lov_exp, qctl); if (rc) GOTO(out, rc); total_limits = qctl->qc_dqblk.dqb_bhardlimit; @@ -1629,7 +1629,7 @@ static int qmaster_recovery_main(void *arg) /* for mds */ class_incref(obd, "qmaster_recovd_mds", obd); /* for lov */ - class_incref(mds->mds_osc_obd, "qmaster_recovd_lov", mds->mds_osc_obd); + class_incref(mds->mds_lov_obd, "qmaster_recovd_lov", mds->mds_lov_obd); cfs_complete(&data->comp); @@ -1664,7 +1664,7 @@ free: OBD_FREE_PTR(dqid); } } - class_decref(mds->mds_osc_obd, "qmaster_recovd_lov", mds->mds_osc_obd); + class_decref(mds->mds_lov_obd, "qmaster_recovd_lov", mds->mds_lov_obd); class_decref(obd, "qmaster_recovd_mds", obd); RETURN(rc); } diff --git a/lustre/tests/replay-dual.sh b/lustre/tests/replay-dual.sh index e6fb1a1..8f0cb52 100755 --- a/lustre/tests/replay-dual.sh +++ b/lustre/tests/replay-dual.sh @@ -5,6 +5,9 @@ set -e # bug number: 10124 ALWAYS_EXCEPT="15c $REPLAY_DUAL_EXCEPT" +LFS=${LFS:-lfs} +SETSTRIPE=${SETSTRIPE:-"$LFS setstripe"} +GETSTRIPE=${GETSTRIPE:-"$LFS getstripe"} SAVE_PWD=$PWD PTLDEBUG=${PTLDEBUG:--1} LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)} @@ -271,20 +274,25 @@ test_14a() { run_test 14a "timeouts waiting for lost client during replay" test_14b() { + wait_mds_ost_sync + wait_destroy_complete BEFOREUSED=`df -P $DIR | tail -1 | awk '{ print $3 }'` mkdir -p $MOUNT1/$tdir + $SETSTRIPE -o 0 $MOUNT1/$tdir replay_barrier $SINGLEMDS - createmany -o $MOUNT1/$tfile- 5 - echo "data" > $MOUNT2/$tdir/$tfile-2 - createmany -o $MOUNT1/$tfile-3- 5 + createmany -o $MOUNT1/$tdir/$tfile- 5 + + $SETSTRIPE -o 0 $MOUNT2/f14b-3 + echo "data" > $MOUNT2/f14b-3 + createmany -o $MOUNT1/$tdir/$tfile-3- 5 umount $MOUNT2 fail $SINGLEMDS wait_recovery_complete $SINGLEMDS || error "MDS recovery not done" # first 25 files should have been replayed - unlinkmany $MOUNT1/$tfile- 5 || return 2 - unlinkmany $MOUNT1/$tfile-3- 5 || return 3 + unlinkmany $MOUNT1/$tdir/$tfile- 5 || return 2 + unlinkmany $MOUNT1/$tdir/$tfile-3- 5 || return 3 zconf_mount `hostname` $MOUNT2 || error "mount $MOUNT2 fail" -- 1.8.3.1