Whamcloud - gitweb
LU-898 ptlrpc: fix ptlrpc request race.
authorAlexander.Boyko <alexander_boyko@xyratex.com>
Fri, 6 Jan 2012 06:38:00 +0000 (10:38 +0400)
committerOleg Drokin <green@whamcloud.com>
Wed, 25 Jan 2012 14:40:36 +0000 (09:40 -0500)
commitea44df63203b65de93e8aefe517059990296565c
tree03a54e783c95e73741df93e55b5d4d658ba36ec1
parent3a78e12f100e43e2996976d06a95a1b8e61b33ff
LU-898 ptlrpc: fix ptlrpc request race.

Allow request reorder from export, only if request has been
added to the list.

Race condition with req error handle at ptlrpc_server_handle_req_in().
1. req is added to rq_export->exp_queued_rpc by ptlrpc_hpreq_init()
2. ptlrpc_server_request_add() returns error ( ost_validate_obdo() whith
one of this condition !(fid_seq_is_rsvd(oa->o_seq) ||
fid_seq_is_idif(oa->o_seq))
3. ptlrpc_server_drop_request(req) drops request (disconnect export),
but req is in rq_export->exp_queued_rpc
4. ldlm_server_blocking_ast handle rq_export->exp_queued_rpc and fail
because req->rq_export is NULL.
Fix allows request reorder from export only if request has been added to
the list. So workaround is not need for situation when request from export
was processed before ptlrpc_server_request_add.

Signed-off-by: Alexander Boyko <alexander_boyko@xyratex.com>
Reviewed-by: Vitaly Fertman <vitaly_fertman@xyratex.com>
Reviewed-by: Denis Kondratenko <denis_kondratenko@xyratex.com>
Reviewed-by: Andrew Perepechko <Andrew_Perepechko@xyratex.com>
Xyratex-bug-id: MRP-284
Change-Id: I5f763b3c4f19b6af5f803b50b43a5570dab3dc76
Reviewed-on: http://review.whamcloud.com/1799
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andrew Perepechko <andrew_perepechko@xyratex.com>
Reviewed-by: Denis Kondratenko <Denis_Kondratenko@xyratex.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/ldlm/ldlm_lockd.c
lustre/ptlrpc/service.c