* resent time, but server sent back service time of original
* RPC.
*/
- CDEBUG((lustre_msg_get_flags(req->rq_reqmsg) & MSG_RESENT) ?
- D_ADAPTTO : D_WARNING,
- "Reported service time %u > total measured time %lld\n",
- service_timeout, now - req->rq_sent);
+ CDEBUG_LIMIT((lustre_msg_get_flags(req->rq_reqmsg) &
+ MSG_RESENT) ? D_ADAPTTO : D_WARNING,
+ "Reported service time %u > total measured time %lld\n",
+ service_timeout, now - req->rq_sent);
return;
}
lustre_msg_set_status(req->rq_reqmsg, current->pid);
- rc = sptlrpc_req_refresh_ctx(req, 0);
+ /* If the request to be sent is an LDLM callback, do not try to
+ * refresh context.
+ * An LDLM callback is sent by a server to a client in order to make
+ * it release a lock, on a communication channel that uses a reverse
+ * context. It cannot be refreshed on its own, as it is the 'reverse'
+ * (server-side) representation of a client context.
+ * We do not care if the reverse context is expired, and want to send
+ * the LDLM callback anyway. Once the client receives the AST, it is
+ * its job to refresh its own context if it has expired, hence
+ * refreshing the associated reverse context on server side, before
+ * being able to send the LDLM_CANCEL requested by the server.
+ */
+ if (lustre_msg_get_opc(req->rq_reqmsg) != LDLM_BL_CALLBACK &&
+ lustre_msg_get_opc(req->rq_reqmsg) != LDLM_CP_CALLBACK &&
+ lustre_msg_get_opc(req->rq_reqmsg) != LDLM_GL_CALLBACK)
+ rc = sptlrpc_req_refresh_ctx(req, 0);
if (rc) {
if (req->rq_err) {
req->rq_status = rc;
*/
void ptlrpc_abort_inflight(struct obd_import *imp)
{
- struct ptlrpc_request *req, *n;
+ struct ptlrpc_request *req;
ENTRY;
/*
* locked? Also, how do we know if the requests on the list are
* being freed at this time?
*/
- list_for_each_entry_safe(req, n, &imp->imp_sending_list, rq_list) {
+ list_for_each_entry(req, &imp->imp_sending_list, rq_list) {
DEBUG_REQ(D_RPCTRACE, req, "inflight");
spin_lock(&req->rq_lock);
spin_unlock(&req->rq_lock);
}
- list_for_each_entry_safe(req, n, &imp->imp_delayed_list, rq_list) {
+ list_for_each_entry(req, &imp->imp_delayed_list, rq_list) {
DEBUG_REQ(D_RPCTRACE, req, "aborting waiting req");
spin_lock(&req->rq_lock);
*/
void ptlrpc_abort_set(struct ptlrpc_request_set *set)
{
- struct ptlrpc_request *req, *tmp;
+ struct ptlrpc_request *req;
LASSERT(set != NULL);
- list_for_each_entry_safe(req, tmp, &set->set_requests, rq_set_chain) {
+ list_for_each_entry(req, &set->set_requests, rq_set_chain) {
spin_lock(&req->rq_lock);
if (req->rq_phase != RQ_PHASE_RPC) {
spin_unlock(&req->rq_lock);