Whamcloud - gitweb
LU-1854 ptlrpc: track culled request seq
authorLiang Zhen <liang@whamcloud.com>
Mon, 10 Sep 2012 07:50:51 +0000 (15:50 +0800)
committerOleg Drokin <green@whamcloud.com>
Mon, 17 Sep 2012 21:40:43 +0000 (17:40 -0400)
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 <liang@whamcloud.com>
Change-Id: I74ed9c7f00e77707628d628792bf9583c4bc4259
Reviewed-on: http://review.whamcloud.com/3916
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: wangdi <di.wang@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/ptlrpc/lproc_ptlrpc.c
lustre/ptlrpc/service.c

index 3ec4f74..50a981f 100644 (file)
@@ -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 */
index 70e9967..672704d 100644 (file)
@@ -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);