Racy bit modification causes assertion failure in
ptlrpc_at_remove_timed():
ASSERTION( !list_empty(&req->rq_srv.sr_timed_list) )
rq_obsolete is a bit field, so it's modification
isn't atomic and should be modified under rq_lock.
Lustre-change: https://review.whamcloud.com/49505
Lustre-commit:
14ac768fd9633c5cf4474555170e5042c71a135b
Change-Id: Ib1d3ad189a78b71ecf5b01585478922e984c9568
HPE-bug-id: LUS-11368
Fixes:
23773b32bf ("LU-11444 ptlrpc: resend may corrupt the data")
Signed-off-by: Andriy Skulysh <andriy.skulysh@hpe.com>
Reviewed-by: Alexander Zarochentsev <alexander.zarochentsev@hpe.com>
Reviewed-by: Neil Brown <neilb@suse.de>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: Gian-Carlo DeFazio <defazio1@llnl.gov>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/52338
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Alexander Boyko <alexander.boyko@hpe.com>
rq_allow_intr:1;
/** @} */
- /** server-side flags @{ */
+ /** server-side flags are serialized by rq_lock @{ */
unsigned int
rq_hp:1, /**< high priority RPC */
rq_at_linked:1, /**< link into service's srv_at_array */
#ifdef HAVE_SERVER_SUPPORT
static void ptlrpc_server_mark_obsolete(struct ptlrpc_request *req)
{
+ spin_lock(&req->rq_lock);
req->rq_obsolete = 1;
+ spin_unlock(&req->rq_lock);
}
static void
ptlrpc_nrs_req_finalize(req);
/* don't mark slot unused for resend in progress */
+ spin_lock(&req->rq_lock);
req->rq_obsolete = 1;
+ spin_unlock(&req->rq_lock);
RETURN(-EBUSY);
}