From: yury Date: Wed, 12 Nov 2008 11:59:45 +0000 (+0000) Subject: b=17037 X-Git-Tag: v1_7_140~1^108 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=bd61018c277bbb9bba8333284db5b4f913a75b6f;p=fs%2Flustre-release.git b=17037 r=tappro,wangdi - fixes ost cleanup issue due to missed llcd_put() in the case ost does not receive disconnect from mds; - do not sleep on hanging llcd. Instead assert on it _after_ stopping recov_thread's ptlrpcd which should kill any remeining llcds; - fixes and cleanups, comments. --- diff --git a/lustre/obdfilter/filter.c b/lustre/obdfilter/filter.c index 726f6aa..c2d07f0 100644 --- a/lustre/obdfilter/filter.c +++ b/lustre/obdfilter/filter.c @@ -2146,6 +2146,12 @@ static int filter_llog_finish(struct obd_device *obd, int count) ctxt = llog_get_context(obd, LLOG_MDS_OST_REPL_CTXT); if (ctxt) { /* + * Make sure that no cached llcds left in recov_thread. We + * actually do sync in disconnect time, but disconnect may + * not come being marked rq_no_resend = 1. + */ + llog_sync(ctxt, NULL); + /* * Balance class_import_get() called in llog_receptor_accept(). * This is safe to do here, as llog is already synchronized and * its import may go. @@ -2567,12 +2573,21 @@ static int filter_disconnect(struct obd_export *exp) { struct obd_device *obd = exp->exp_obd; struct llog_ctxt *ctxt; - int rc, err; + int rc; ENTRY; LASSERT(exp); class_export_get(exp); + /* Flush any remaining cancel messages out to the target */ + ctxt = llog_get_context(obd, LLOG_MDS_OST_REPL_CTXT); + if (ctxt) { + if (ctxt->loc_imp == exp->exp_imp_reverse) + CDEBUG(D_RPCTRACE, "Reverse import disconnect\n"); + llog_sync(ctxt, exp); + llog_ctxt_put(ctxt); + } + if (!(exp->exp_flags & OBD_OPT_FORCE)) filter_grant_sanity_check(obd, __FUNCTION__); filter_grant_discard(exp); @@ -2583,15 +2598,6 @@ static int filter_disconnect(struct obd_export *exp) ldlm_cancel_locks_for_export(exp); lprocfs_exp_cleanup(exp); - - /* flush any remaining cancel messages out to the target */ - ctxt = llog_get_context(obd, LLOG_MDS_OST_REPL_CTXT); - err = llog_sync(ctxt, exp); - llog_ctxt_put(ctxt); - - if (err) - CERROR("error flushing logs to MDS: rc %d\n", err); - class_export_put(exp); RETURN(rc); } @@ -3641,13 +3647,19 @@ static int filter_sync(struct obd_export *exp, struct obdo *oa, filter = &exp->exp_obd->u.filter; - /* an objid of zero is taken to mean "sync whole filesystem" */ + /* An objid of zero is taken to mean "sync whole filesystem" */ if (!oa || !(oa->o_valid & OBD_MD_FLID)) { rc = fsfilt_sync(exp->exp_obd, filter->fo_obt.obt_sb); - /* flush any remaining cancel messages out to the target */ + + /* Flush any remaining cancel messages out to the target */ ctxt = llog_get_context(exp->exp_obd, LLOG_MDS_OST_REPL_CTXT); - llog_sync(ctxt, exp); - llog_ctxt_put(ctxt); + if (ctxt) { + llog_sync(ctxt, exp); + llog_ctxt_put(ctxt); + } else { + CERROR("No LLOG_MDS_OST_REPL_CTXT found in obd %p\n", + exp->exp_obd); + } RETURN(rc); }