From 0c3cb273e1ce629072da4d790cba5e13163c43c6 Mon Sep 17 00:00:00 2001 From: Liang Zhen Date: Mon, 10 Sep 2012 15:50:51 +0800 Subject: [PATCH 1/1] LU-1854 ptlrpc: track culled request seq Ptlrpc service should track highest culled request-seq by storing it in ptlrpc_servce_part::scp_hist_seq_culled, however, there is a missed case in ptlrpc_server_drop_request(): if rq_reply_state of the request is pre-allocated and it should be freed immediately, ptlrpc_server_drop_request() will unlink the request from history list w/o track sequence number, and it can be the reason of hitting LASSERT while reading req_history. Signed-off-by: Liang Zhen Change-Id: I74ed9c7f00e77707628d628792bf9583c4bc4259 Reviewed-on: http://review.whamcloud.com/3916 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: wangdi Reviewed-by: Oleg Drokin --- lustre/ptlrpc/lproc_ptlrpc.c | 6 +++++- lustre/ptlrpc/service.c | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lustre/ptlrpc/lproc_ptlrpc.c b/lustre/ptlrpc/lproc_ptlrpc.c index 3ec4f74..50a981f 100644 --- a/lustre/ptlrpc/lproc_ptlrpc.c +++ b/lustre/ptlrpc/lproc_ptlrpc.c @@ -428,7 +428,11 @@ ptlrpc_lprocfs_svc_req_history_seek(struct ptlrpc_service_part *svcpt, * be near the head), we shouldn't have to do long * re-scans */ LASSERT (srhi->srhi_seq == srhi->srhi_req->rq_history_seq); - LASSERT(!cfs_list_empty(&svcpt->scp_hist_reqs)); + LASSERTF(!cfs_list_empty(&svcpt->scp_hist_reqs), + "%s:%d: seek offset "LPU64", request seq "LPU64", " + "last culled "LPU64"\n", + svcpt->scp_service->srv_name, svcpt->scp_cpt, + seq, srhi->srhi_seq, svcpt->scp_hist_seq_culled); e = &srhi->srhi_req->rq_history_list; } else { /* search from start */ diff --git a/lustre/ptlrpc/service.c b/lustre/ptlrpc/service.c index 70e9967..672704d 100644 --- a/lustre/ptlrpc/service.c +++ b/lustre/ptlrpc/service.c @@ -943,6 +943,10 @@ void ptlrpc_server_drop_request(struct ptlrpc_request *req) cfs_list_del(&req->rq_list); cfs_list_del_init(&req->rq_history_list); + /* Track the highest culled req seq */ + if (req->rq_history_seq > svcpt->scp_hist_seq_culled) + svcpt->scp_hist_seq_culled = req->rq_history_seq; + cfs_spin_unlock(&svcpt->scp_lock); ptlrpc_server_free_request(req); -- 1.8.3.1