From: Alex Zhuravlev Date: Mon, 18 Feb 2013 06:04:07 +0000 (+0400) Subject: LU-2556 osp: count requests in osp_sync_interpret() only X-Git-Tag: 2.3.64~80 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=7e133f92b7680a3df22d1351ad8de495beaac592;p=fs%2Flustre-release.git LU-2556 osp: count requests in osp_sync_interpret() only as it's called by ptlrpc always, so any counting in osp_sync_request_commit_cb() is extra and wrong. Signed-off-by: Alex Zhuravlev Change-Id: Ib67ba11d2c382b1ff9cd19522ce9e15b57ebca94 Reviewed-on: http://review.whamcloud.com/5453 Tested-by: Hudson Tested-by: Maloo Reviewed-by: wangdi Reviewed-by: Fan Yong Tested-by: Oleg Drokin Reviewed-by: Oleg Drokin --- diff --git a/lustre/osp/osp_sync.c b/lustre/osp/osp_sync.c index 219744f..dfa263e 100644 --- a/lustre/osp/osp_sync.c +++ b/lustre/osp/osp_sync.c @@ -316,25 +316,15 @@ int osp_sync_gap(const struct lu_env *env, struct osp_device *d, static void osp_sync_request_commit_cb(struct ptlrpc_request *req) { struct osp_device *d = req->rq_cb_data; - struct obd_import *imp = req->rq_import; CDEBUG(D_HA, "commit req %p, transno "LPU64"\n", req, req->rq_transno); if (unlikely(req->rq_transno == 0)) return; - if (unlikely(req->rq_transno > imp->imp_peer_committed_transno)) { - /* this request was aborted by the shutdown procedure, - * not committed by the peer. we should preserve llog - * record */ - spin_lock(&d->opd_syn_lock); - d->opd_syn_rpc_in_progress--; - spin_unlock(&d->opd_syn_lock); - cfs_waitq_signal(&d->opd_syn_waitq); - return; - } + /* do not do any opd_dyn_rpc_* accounting here + * it's done in osp_sync_interpret sooner or later */ - /* XXX: what if request isn't committed for very long? */ LASSERT(d); LASSERT(req->rq_svc_thread == (void *) OSP_JOB_MAGIC); LASSERT(cfs_list_empty(&req->rq_exp_list)); @@ -354,7 +344,6 @@ static int osp_sync_interpret(const struct lu_env *env, { struct osp_device *d = req->rq_cb_data; - /* XXX: error handling here */ if (req->rq_svc_thread != (void *) OSP_JOB_MAGIC) DEBUG_REQ(D_ERROR, req, "bad magic %p\n", req->rq_svc_thread); LASSERT(req->rq_svc_thread == (void *) OSP_JOB_MAGIC); @@ -390,11 +379,11 @@ static int osp_sync_interpret(const struct lu_env *env, "transno "LPU64", rc %d, gen: req %d, imp %d\n", req->rq_transno, rc, req->rq_import_generation, imp->imp_generation); - LASSERT(d->opd_syn_rpc_in_progress > 0); if (req->rq_transno == 0) { /* this is the last time we see the request * if transno is not zero, then commit cb * will be called at some point */ + LASSERT(d->opd_syn_rpc_in_progress > 0); spin_lock(&d->opd_syn_lock); d->opd_syn_rpc_in_progress--; spin_unlock(&d->opd_syn_lock);