1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
4 * Copyright (C) 2002 Cluster File Systems, Inc.
6 * This file is part of Lustre, http://www.lustre.org.
8 * Lustre is free software; you can redistribute it and/or
9 * modify it under the terms of version 2 of the GNU General Public
10 * License as published by the Free Software Foundation.
12 * Lustre is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Lustre; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 #define DEBUG_SUBSYSTEM S_RPC
25 #include <linux/obd_support.h>
26 #include <linux/obd_class.h>
27 #include <linux/lustre_lib.h>
28 #include <linux/lustre_ha.h>
29 #include <linux/lustre_import.h>
31 void ptlrpc_init_client(int req_portal, int rep_portal, char *name,
32 struct ptlrpc_client *cl)
34 cl->cli_request_portal = req_portal;
35 cl->cli_reply_portal = rep_portal;
39 __u8 *ptlrpc_req_to_uuid(struct ptlrpc_request *req)
41 return req->rq_connection->c_remote_uuid;
44 struct ptlrpc_connection *ptlrpc_uuid_to_connection(obd_uuid_t uuid)
46 struct ptlrpc_connection *c;
47 struct lustre_peer peer;
50 err = kportal_uuid_to_peer(uuid, &peer);
52 CERROR("cannot find peer %s!\n", uuid);
56 c = ptlrpc_get_connection(&peer, uuid);
58 memcpy(c->c_remote_uuid, uuid, sizeof(c->c_remote_uuid));
62 CDEBUG(D_INFO, "%s -> %p\n", uuid, c);
67 void ptlrpc_readdress_connection(struct ptlrpc_connection *conn,obd_uuid_t uuid)
69 struct lustre_peer peer;
72 err = kportal_uuid_to_peer(uuid, &peer);
74 CERROR("cannot find peer %s!\n", uuid);
78 memcpy(&conn->c_peer, &peer, sizeof(peer));
82 struct ptlrpc_bulk_desc *ptlrpc_prep_bulk(struct ptlrpc_connection *conn)
84 struct ptlrpc_bulk_desc *desc;
86 OBD_ALLOC(desc, sizeof(*desc));
88 desc->bd_connection = ptlrpc_connection_addref(conn);
89 atomic_set(&desc->bd_refcount, 1);
90 init_waitqueue_head(&desc->bd_waitq);
91 INIT_LIST_HEAD(&desc->bd_page_list);
92 INIT_LIST_HEAD(&desc->bd_set_chain);
93 ptl_set_inv_handle(&desc->bd_md_h);
94 ptl_set_inv_handle(&desc->bd_me_h);
100 int ptlrpc_bulk_error(struct ptlrpc_bulk_desc *desc)
103 if (desc->bd_flags & PTL_RPC_FL_TIMEOUT) {
104 rc = (desc->bd_flags & PTL_RPC_FL_INTR ? -ERESTARTSYS :
110 struct ptlrpc_bulk_page *ptlrpc_prep_bulk_page(struct ptlrpc_bulk_desc *desc)
112 struct ptlrpc_bulk_page *bulk;
114 OBD_ALLOC(bulk, sizeof(*bulk));
116 bulk->bp_desc = desc;
117 list_add_tail(&bulk->bp_link, &desc->bd_page_list);
118 desc->bd_page_count++;
123 void ptlrpc_free_bulk(struct ptlrpc_bulk_desc *desc)
125 struct list_head *tmp, *next;
132 LASSERT(list_empty(&desc->bd_set_chain));
134 list_for_each_safe(tmp, next, &desc->bd_page_list) {
135 struct ptlrpc_bulk_page *bulk;
136 bulk = list_entry(tmp, struct ptlrpc_bulk_page, bp_link);
137 ptlrpc_free_bulk_page(bulk);
140 ptlrpc_put_connection(desc->bd_connection);
142 OBD_FREE(desc, sizeof(*desc));
146 void ptlrpc_free_bulk_page(struct ptlrpc_bulk_page *bulk)
154 list_del(&bulk->bp_link);
155 bulk->bp_desc->bd_page_count--;
156 OBD_FREE(bulk, sizeof(*bulk));
160 static int ll_sync_brw_timeout(void *data)
162 struct obd_brw_set *set = data;
163 struct list_head *tmp;
169 set->brw_flags |= PTL_RPC_FL_TIMEOUT;
171 list_for_each(tmp, &set->brw_desc_head) {
172 struct ptlrpc_bulk_desc *desc =
173 list_entry(tmp, struct ptlrpc_bulk_desc, bd_set_chain);
175 /* Skip descriptors that were completed successfully. */
176 if (desc->bd_flags & (PTL_BULK_FL_RCVD | PTL_BULK_FL_SENT))
179 LASSERT(desc->bd_connection);
181 /* If PtlMDUnlink succeeds, then it hasn't completed yet. If it
182 * fails, the bulk finished _just_ in time (after the timeout
183 * fired but before we got this far) and we'll let it live.
185 if (PtlMDUnlink(desc->bd_md_h) != 0) {
186 CERROR("Near-miss on OST %s -- need to adjust "
188 desc->bd_connection->c_remote_uuid);
192 CERROR("IO of %d pages to/from %s:%d (conn %p) timed out\n",
193 desc->bd_page_count, desc->bd_connection->c_remote_uuid,
194 desc->bd_portal, desc->bd_connection);
196 /* This one will "never" arrive, don't wait for it. */
197 if (atomic_dec_and_test(&set->brw_refcount))
198 wake_up(&set->brw_waitq);
200 if (class_signal_connection_failure)
201 class_signal_connection_failure(desc->bd_connection);
206 /* 0 = We go back to sleep, until we're resumed or interrupted */
207 /* 1 = We can't be recovered, just abort the syscall with -ETIMEDOUT */
211 static int ll_sync_brw_intr(void *data)
213 struct obd_brw_set *set = data;
216 set->brw_flags |= PTL_RPC_FL_INTR;
217 RETURN(1); /* ignored, as of this writing */
220 int ll_brw_sync_wait(struct obd_brw_set *set, int phase)
222 struct l_wait_info lwi;
223 struct list_head *tmp, *next;
229 lwi = LWI_TIMEOUT_INTR(obd_timeout * HZ, ll_sync_brw_timeout,
230 ll_sync_brw_intr, set);
231 rc = l_wait_event(set->brw_waitq,
232 atomic_read(&set->brw_refcount) == 0, &lwi);
234 list_for_each_safe(tmp, next, &set->brw_desc_head) {
235 struct ptlrpc_bulk_desc *desc =
236 list_entry(tmp, struct ptlrpc_bulk_desc,
238 list_del_init(&desc->bd_set_chain);
239 ptlrpc_bulk_decref(desc);
242 case CB_PHASE_FINISH:
243 if (atomic_dec_and_test(&set->brw_refcount))
244 wake_up(&set->brw_waitq);
253 struct ptlrpc_request *ptlrpc_prep_req(struct obd_import *imp, int opcode,
254 int count, int *lengths, char **bufs)
256 struct ptlrpc_connection *conn = imp->imp_connection;
257 struct ptlrpc_request *request;
261 OBD_ALLOC(request, sizeof(*request));
263 CERROR("request allocation out of memory\n");
267 rc = lustre_pack_msg(count, lengths, bufs,
268 &request->rq_reqlen, &request->rq_reqmsg);
270 CERROR("cannot pack request %d\n", rc);
271 OBD_FREE(request, sizeof(*request));
275 request->rq_level = LUSTRE_CONN_FULL;
276 request->rq_type = PTL_RPC_MSG_REQUEST;
277 request->rq_import = imp;
279 /* XXX FIXME bug 625069 */
280 request->rq_request_portal = imp->imp_client->cli_request_portal;
281 request->rq_reply_portal = imp->imp_client->cli_reply_portal;
283 request->rq_connection = ptlrpc_connection_addref(conn);
285 INIT_LIST_HEAD(&request->rq_list);
286 atomic_set(&request->rq_refcount, 1);
288 spin_lock(&imp->imp_lock);
289 request->rq_xid = HTON__u32(++imp->imp_last_xid);
290 spin_unlock(&imp->imp_lock);
292 request->rq_reqmsg->magic = PTLRPC_MSG_MAGIC;
293 request->rq_reqmsg->version = PTLRPC_MSG_VERSION;
294 request->rq_reqmsg->opc = HTON__u32(opcode);
295 request->rq_reqmsg->flags = 0;
297 ptlrpc_hdl2req(request, &imp->imp_handle);
301 static void __ptlrpc_free_req(struct ptlrpc_request *request, int locked)
304 if (request == NULL) {
309 if (atomic_read(&request->rq_refcount) != 0) {
310 CERROR("freeing request %p (%d->%s:%d) with refcount %d\n",
311 request, request->rq_reqmsg->opc,
312 request->rq_connection->c_remote_uuid,
313 request->rq_import->imp_client->cli_request_portal,
314 request->rq_refcount);
318 if (request->rq_repmsg != NULL) {
319 OBD_FREE(request->rq_repmsg, request->rq_replen);
320 request->rq_repmsg = NULL;
321 request->rq_reply_md.start = NULL;
323 if (request->rq_reqmsg != NULL) {
324 OBD_FREE(request->rq_reqmsg, request->rq_reqlen);
325 request->rq_reqmsg = NULL;
328 if (request->rq_import) {
330 spin_lock(&request->rq_import->imp_lock);
331 list_del_init(&request->rq_list);
333 spin_unlock(&request->rq_import->imp_lock);
336 ptlrpc_put_connection(request->rq_connection);
337 OBD_FREE(request, sizeof(*request));
341 void ptlrpc_free_req(struct ptlrpc_request *request)
343 __ptlrpc_free_req(request, 0);
346 static int __ptlrpc_req_finished(struct ptlrpc_request *request, int locked)
352 DEBUG_REQ(D_INFO, request, "refcount now %u",
353 atomic_read(&request->rq_refcount) - 1);
355 if (atomic_dec_and_test(&request->rq_refcount)) {
356 __ptlrpc_free_req(request, locked);
363 void ptlrpc_req_finished(struct ptlrpc_request *request)
365 __ptlrpc_req_finished(request, 0);
368 static int ptlrpc_check_reply(struct ptlrpc_request *req)
373 if (req->rq_repmsg != NULL) {
374 req->rq_transno = NTOH__u64(req->rq_repmsg->transno);
375 req->rq_flags |= PTL_RPC_FL_REPLIED;
379 if (req->rq_flags & PTL_RPC_FL_RESEND) {
381 DEBUG_REQ(D_ERROR, req, "RESEND:");
385 if (req->rq_flags & PTL_RPC_FL_ERR) {
387 DEBUG_REQ(D_ERROR, req, "ABORTED:");
391 if (req->rq_flags & PTL_RPC_FL_RESTART) {
392 DEBUG_REQ(D_ERROR, req, "RESTART:");
397 DEBUG_REQ(D_NET, req, "rc = %d for", rc);
401 static int ptlrpc_check_status(struct ptlrpc_request *req)
406 err = req->rq_repmsg->status;
407 if (req->rq_repmsg->type == NTOH__u32(PTL_RPC_MSG_ERR)) {
408 DEBUG_REQ(D_ERROR, req, "type == PTL_RPC_MSG_ERR");
409 RETURN(err ? err : -EINVAL);
413 DEBUG_REQ(D_ERROR, req, "status is %d", err);
414 } else if (err > 0) {
415 /* XXX: translate this error from net to host */
416 DEBUG_REQ(D_INFO, req, "status is %d", err);
422 static void ptlrpc_cleanup_request_buf(struct ptlrpc_request *request)
424 OBD_FREE(request->rq_reqmsg, request->rq_reqlen);
425 request->rq_reqmsg = NULL;
426 request->rq_reqlen = 0;
429 /* Abort this request and cleanup any resources associated with it. */
430 static int ptlrpc_abort(struct ptlrpc_request *request)
432 /* First remove the ME for the reply; in theory, this means
433 * that we can tear down the buffer safely. */
434 PtlMEUnlink(request->rq_reply_me_h);
435 OBD_FREE(request->rq_reply_md.start, request->rq_replen);
436 request->rq_repmsg = NULL;
437 request->rq_replen = 0;
441 /* caller must hold imp->imp_lock */
442 void ptlrpc_free_committed(struct obd_import *imp)
444 struct list_head *tmp, *saved;
445 struct ptlrpc_request *req;
449 LASSERT(spin_is_locked(&imp->imp_lock));
452 CDEBUG(D_HA, "committing for xid "LPU64", last_committed "LPU64"\n",
453 imp->imp_peer_last_xid, imp->imp_peer_committed_transno);
455 list_for_each_safe(tmp, saved, &imp->imp_replay_list) {
456 req = list_entry(tmp, struct ptlrpc_request, rq_list);
458 if (req->rq_flags & PTL_RPC_FL_REPLAY) {
459 DEBUG_REQ(D_HA, req, "keeping (FL_REPLAY)");
463 /* not yet committed */
464 if (req->rq_transno > imp->imp_peer_committed_transno) {
465 DEBUG_REQ(D_HA, req, "stopping search");
469 DEBUG_REQ(D_HA, req, "committing (last_committed "LPU64")",
470 imp->imp_peer_committed_transno);
471 __ptlrpc_req_finished(req, 1);
478 void ptlrpc_cleanup_client(struct obd_import *imp)
480 struct list_head *tmp, *saved;
481 struct ptlrpc_request *req;
482 struct ptlrpc_connection *conn = imp->imp_connection;
487 spin_lock(&imp->imp_lock);
488 list_for_each_safe(tmp, saved, &imp->imp_replay_list) {
489 req = list_entry(tmp, struct ptlrpc_request, rq_list);
491 /* XXX we should make sure that nobody's sleeping on these! */
492 DEBUG_REQ(D_HA, req, "cleaning up from sending list");
493 list_del_init(&req->rq_list);
494 req->rq_import = NULL;
495 __ptlrpc_req_finished(req, 0);
497 spin_unlock(&imp->imp_lock);
503 void ptlrpc_continue_req(struct ptlrpc_request *req)
506 DEBUG_REQ(D_HA, req, "continuing delayed request");
507 req->rq_reqmsg->addr = req->rq_import->imp_handle.addr;
508 req->rq_reqmsg->cookie = req->rq_import->imp_handle.cookie;
509 wake_up(&req->rq_wait_for_rep);
513 void ptlrpc_resend_req(struct ptlrpc_request *req)
516 DEBUG_REQ(D_HA, req, "resending");
517 req->rq_reqmsg->addr = req->rq_import->imp_handle.addr;
518 req->rq_reqmsg->cookie = req->rq_import->imp_handle.cookie;
519 req->rq_status = -EAGAIN;
520 req->rq_level = LUSTRE_CONN_RECOVD;
521 req->rq_flags |= PTL_RPC_FL_RESEND;
522 req->rq_flags &= ~PTL_RPC_FL_TIMEOUT;
523 wake_up(&req->rq_wait_for_rep);
527 void ptlrpc_restart_req(struct ptlrpc_request *req)
530 DEBUG_REQ(D_HA, req, "restarting (possibly-)completed request");
531 req->rq_status = -ERESTARTSYS;
532 req->rq_flags |= PTL_RPC_FL_RESTART;
533 req->rq_flags &= ~PTL_RPC_FL_TIMEOUT;
534 wake_up(&req->rq_wait_for_rep);
538 static int expired_request(void *data)
540 struct ptlrpc_request *req = data;
549 DEBUG_REQ(D_ERROR, req, "timeout");
550 req->rq_flags |= PTL_RPC_FL_TIMEOUT;
552 if (!req->rq_import) {
553 DEBUG_REQ(D_ERROR, req, "NULL import");
558 if (!req->rq_import->imp_connection) {
559 DEBUG_REQ(D_ERROR, req, "NULL connection");
564 if (!req->rq_import->imp_connection->c_recovd_data.rd_recovd)
568 recovd_conn_fail(req->rq_import->imp_connection);
571 /* If this request is for recovery or other primordial tasks,
572 * don't go back to sleep.
574 if (req->rq_level < LUSTRE_CONN_FULL)
580 static int interrupted_request(void *data)
582 struct ptlrpc_request *req = data;
584 req->rq_flags |= PTL_RPC_FL_INTR;
585 RETURN(1); /* ignored, as of this writing */
588 /* If the import has been invalidated (such as by an OST failure), the
589 * request must fail with -EIO.
591 * Must be called with imp_lock held, will drop it if it returns -EIO.
593 #define EIO_IF_INVALID(req) \
594 if (req->rq_import->imp_flags & IMP_INVALID) { \
595 DEBUG_REQ(D_ERROR, req, "IMP_INVALID:"); \
596 spin_unlock(&imp->imp_lock); \
600 int ptlrpc_queue_wait(struct ptlrpc_request *req)
603 struct l_wait_info lwi;
604 struct obd_import *imp = req->rq_import;
605 struct ptlrpc_connection *conn = imp->imp_connection;
608 init_waitqueue_head(&req->rq_wait_for_rep);
610 /* for distributed debugging */
611 req->rq_reqmsg->status = HTON__u32(current->pid);
612 CDEBUG(D_RPCTRACE, "Sending RPC pid:xid:nid:opc %d:"LPU64":%x:%d\n",
613 NTOH__u32(req->rq_reqmsg->status), req->rq_xid,
614 conn->c_peer.peer_nid, NTOH__u32(req->rq_reqmsg->opc));
616 if (req->rq_level > imp->imp_level) {
617 spin_lock(&imp->imp_lock);
619 list_del(&req->rq_list);
620 list_add_tail(&req->rq_list, &imp->imp_delayed_list);
621 spin_unlock(&imp->imp_lock);
623 DEBUG_REQ(D_HA, req, "\"%s\" waiting for recovery: (%d < %d)",
624 current->comm, req->rq_level, imp->imp_level);
625 lwi = LWI_INTR(NULL, NULL);
626 rc = l_wait_event(req->rq_wait_for_rep,
627 (req->rq_level <= imp->imp_level) ||
628 (req->rq_flags & PTL_RPC_FL_ERR), &lwi);
630 spin_lock(&imp->imp_lock);
631 list_del_init(&req->rq_list);
632 spin_unlock(&imp->imp_lock);
634 if (req->rq_flags & PTL_RPC_FL_ERR)
640 CERROR("process %d resumed\n", current->pid);
643 req->rq_timeout = obd_timeout;
644 spin_lock(&imp->imp_lock);
647 LASSERT(list_empty(&req->rq_list));
648 list_add_tail(&req->rq_list, &imp->imp_sending_list);
649 spin_unlock(&imp->imp_lock);
650 rc = ptl_send_rpc(req);
652 CDEBUG(D_HA, "error %d, opcode %d, need recovery\n", rc,
653 req->rq_reqmsg->opc);
654 /* sleep for a jiffy, then trigger recovery */
655 lwi = LWI_TIMEOUT_INTR(1, expired_request,
656 interrupted_request, req);
658 DEBUG_REQ(D_NET, req, "-- sleeping");
659 lwi = LWI_TIMEOUT_INTR(req->rq_timeout * HZ, expired_request,
660 interrupted_request, req);
662 l_wait_event(req->rq_wait_for_rep, ptlrpc_check_reply(req), &lwi);
663 DEBUG_REQ(D_NET, req, "-- done sleeping");
665 spin_lock(&imp->imp_lock);
666 list_del_init(&req->rq_list);
667 spin_unlock(&imp->imp_lock);
669 if (req->rq_flags & PTL_RPC_FL_ERR) {
671 GOTO(out, rc = -EIO);
674 /* Don't resend if we were interrupted. */
675 if ((req->rq_flags & (PTL_RPC_FL_RESEND | PTL_RPC_FL_INTR)) ==
677 req->rq_flags &= ~PTL_RPC_FL_RESEND;
678 DEBUG_REQ(D_HA, req, "resending: ");
682 if (req->rq_flags & PTL_RPC_FL_INTR) {
683 if (!(req->rq_flags & PTL_RPC_FL_TIMEOUT))
684 LBUG(); /* should only be interrupted if we timed out */
685 /* Clean up the dangling reply buffers */
687 GOTO(out, rc = -EINTR);
690 if (req->rq_flags & PTL_RPC_FL_TIMEOUT)
691 GOTO(out, rc = -ETIMEDOUT);
693 if (!(req->rq_flags & PTL_RPC_FL_REPLIED))
694 GOTO(out, rc = req->rq_status);
696 rc = lustre_unpack_msg(req->rq_repmsg, req->rq_replen);
698 CERROR("unpack_rep failed: %d\n", rc);
702 /* FIXME: Enable when BlueArc makes new release */
703 if (req->rq_repmsg->type != PTL_RPC_MSG_REPLY &&
704 req->rq_repmsg->type != PTL_RPC_MSG_ERR) {
705 CERROR("invalid packet type received (type=%u)\n",
706 req->rq_repmsg->type);
708 GOTO(out, rc = -EINVAL);
711 CDEBUG(D_NET, "got rep "LPU64"\n", req->rq_xid);
712 if (req->rq_repmsg->status == 0)
713 CDEBUG(D_NET, "--> buf %p len %d status %d\n", req->rq_repmsg,
714 req->rq_replen, req->rq_repmsg->status);
717 if (req->rq_import->imp_flags & IMP_REPLAYABLE) {
718 spin_lock(&imp->imp_lock);
719 if (req->rq_flags & PTL_RPC_FL_REPLAY || req->rq_transno != 0) {
720 /* Balanced in ptlrpc_free_committed, usually. */
721 atomic_inc(&req->rq_refcount);
722 list_add_tail(&req->rq_list, &imp->imp_replay_list);
725 if (req->rq_transno > imp->imp_max_transno) {
726 imp->imp_max_transno = req->rq_transno;
727 } else if (req->rq_transno != 0 &&
728 imp->imp_level == LUSTRE_CONN_FULL) {
729 CERROR("got transno "LPD64" after "LPD64": recovery "
730 "may not work\n", req->rq_transno,
731 imp->imp_max_transno);
734 /* Replay-enabled imports return commit-status information. */
735 imp->imp_peer_last_xid = req->rq_repmsg->last_xid;
736 imp->imp_peer_committed_transno =
737 req->rq_repmsg->last_committed;
738 ptlrpc_free_committed(imp);
739 spin_unlock(&imp->imp_lock);
742 rc = ptlrpc_check_status(req);
749 #undef EIO_IF_INVALID
751 int ptlrpc_replay_req(struct ptlrpc_request *req)
753 int rc = 0, old_level, old_status = 0;
754 // struct ptlrpc_client *cli = req->rq_import->imp_client;
755 struct l_wait_info lwi;
758 init_waitqueue_head(&req->rq_wait_for_rep);
759 DEBUG_REQ(D_NET, req, "");
761 req->rq_timeout = obd_timeout;
762 req->rq_reqmsg->addr = req->rq_import->imp_handle.addr;
763 req->rq_reqmsg->cookie = req->rq_import->imp_handle.cookie;
765 /* temporarily set request to RECOVD level (reset at out:) */
766 old_level = req->rq_level;
767 if (req->rq_flags & PTL_RPC_FL_REPLIED)
768 old_status = req->rq_repmsg->status;
769 req->rq_level = LUSTRE_CONN_RECOVD;
770 rc = ptl_send_rpc(req);
772 CERROR("error %d, opcode %d\n", rc, req->rq_reqmsg->opc);
773 ptlrpc_cleanup_request_buf(req);
774 // up(&cli->cli_rpc_sem);
778 CDEBUG(D_OTHER, "-- sleeping\n");
779 lwi = LWI_INTR(NULL, NULL); /* XXX needs timeout, nested recovery */
780 l_wait_event(req->rq_wait_for_rep, ptlrpc_check_reply(req), &lwi);
781 CDEBUG(D_OTHER, "-- done\n");
783 // up(&cli->cli_rpc_sem);
785 if (!(req->rq_flags & PTL_RPC_FL_REPLIED)) {
786 CERROR("Unknown reason for wakeup\n");
787 /* XXX Phil - I end up here when I kill obdctl */
789 GOTO(out, rc = -EINTR);
792 rc = lustre_unpack_msg(req->rq_repmsg, req->rq_replen);
794 CERROR("unpack_rep failed: %d\n", rc);
798 CDEBUG(D_NET, "got rep "LPD64"\n", req->rq_xid);
800 /* let the callback do fixups, possibly including in the request */
801 if (req->rq_replay_cb)
802 req->rq_replay_cb(req);
804 if ((req->rq_flags & PTL_RPC_FL_REPLIED) &&
805 req->rq_repmsg->status != old_status) {
806 DEBUG_REQ(D_HA, req, "status %d, old was %d",
807 req->rq_repmsg->status, old_status);
811 req->rq_level = old_level;