}
if (req->rq_err) {
+ cfs_spin_lock(&req->rq_lock);
req->rq_replied = 0;
+ cfs_spin_unlock(&req->rq_lock);
if (req->rq_status == 0)
req->rq_status = -EIO;
ptlrpc_rqphase_move(req, RQ_PHASE_INTERPRET);
cfs_spin_unlock(&imp->imp_lock);
+ cfs_spin_lock(&req->rq_lock);
req->rq_waiting = 0;
+ cfs_spin_unlock(&req->rq_lock);
if (req->rq_timedout||req->rq_resend) {
/* This is re-sending anyways,
* let's mark req as resend. */
+ cfs_spin_lock(&req->rq_lock);
req->rq_resend = 1;
+ cfs_spin_unlock(&req->rq_lock);
if (req->rq_bulk) {
__u64 old_xid;
if (status) {
if (req->rq_err) {
req->rq_status = status;
+ cfs_spin_lock(&req->rq_lock);
req->rq_wait_ctx = 0;
+ cfs_spin_unlock(&req->rq_lock);
force_timer_recalc = 1;
} else {
+ cfs_spin_lock(&req->rq_lock);
req->rq_wait_ctx = 1;
+ cfs_spin_unlock(&req->rq_lock);
}
continue;
} else {
+ cfs_spin_lock(&req->rq_lock);
req->rq_wait_ctx = 0;
+ cfs_spin_unlock(&req->rq_lock);
}
rc = ptl_send_rpc(req, 0);
DEBUG_REQ(D_HA, req, "send failed (%d)",
rc);
force_timer_recalc = 1;
+ cfs_spin_lock(&req->rq_lock);
req->rq_net_err = 1;
+ cfs_spin_unlock(&req->rq_lock);
}
/* need to reset the timeout */
force_timer_recalc = 1;
LASSERT(req->rq_reply_state == NULL);
- if ((flags & LPRFL_EARLY_REPLY) == 0)
+ if ((flags & LPRFL_EARLY_REPLY) == 0) {
+ cfs_spin_lock(&req->rq_lock);
req->rq_packed_final = 1;
+ cfs_spin_unlock(&req->rq_lock);
+ }
msg_len = lustre_msg_size_v2(count, lens);
rc = sptlrpc_svc_alloc_rs(req, msg_len);
}
if (unlikely(cfs_test_bit(PTLRPC_CTX_ERROR_BIT, &ctx->cc_flags))) {
+ cfs_spin_lock(&req->rq_lock);
req->rq_err = 1;
+ cfs_spin_unlock(&req->rq_lock);
req_off_ctx_list(req, ctx);
RETURN(-EPERM);
}
* don't switch ctx if import was deactivated
*/
if (req->rq_import->imp_deactive) {
+ cfs_spin_lock(&req->rq_lock);
req->rq_err = 1;
+ cfs_spin_unlock(&req->rq_lock);
RETURN(-EINTR);
}
LASSERT(ctx == req->rq_cli_ctx);
CERROR("req %p: failed to replace dead ctx %p: %d\n",
req, ctx, rc);
+ cfs_spin_lock(&req->rq_lock);
req->rq_err = 1;
+ cfs_spin_unlock(&req->rq_lock);
RETURN(rc);
}
LASSERT(!cfs_list_empty(&req->rq_timed_list));
cfs_list_del_init(&req->rq_timed_list);
+ cfs_spin_lock(&req->rq_lock);
req->rq_at_linked = 0;
+ cfs_spin_unlock(&req->rq_lock);
array->paa_reqs_count[index]--;
array->paa_count--;
} else
cfs_list_add(&req->rq_timed_list,
&array->paa_reqs_array[index]);
+ cfs_spin_lock(&req->rq_lock);
req->rq_at_linked = 1;
+ cfs_spin_unlock(&req->rq_lock);
req->rq_at_index = index;
array->paa_reqs_count[index]++;
array->paa_count++;
counter++;
array->paa_reqs_count[index]--;
array->paa_count--;
+ cfs_spin_lock(&rq->rq_lock);
rq->rq_at_linked = 0;
+ cfs_spin_unlock(&rq->rq_lock);
continue;
}