* Copyright (C) 2002 Cluster File Systems, Inc.
* Author: Eric Barton <eric@bartonsoftware.com>
*
- * Copyright (C) 2002, Lawrence Livermore National Labs (LLNL)
- * W. Marcus Miller - Based on ksocknal
- *
- * This file is part of Portals, http://www.sf.net/projects/sandiaportals/
+ * This file is part of Portals, http://www.lustre.org
*
* Portals is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
LASSERT (ktx->ktx_state == KTX_RDMAING);
LASSERT (krx->krx_rxd == rxd);
+ /* RPC completes with failure by default */
LASSERT (krx->krx_rpc_reply_needed);
+ LASSERT (krx->krx_rpc_reply_status != 0);
- /* Set the RPC completion status */
- status = (status == EP_SUCCESS) ? 0 : -ECONNABORTED;
- krx->krx_rpc_reply_status = status;
+ if (status == EP_SUCCESS) {
+ status = krx->krx_rpc_reply_status = 0;
+ } else {
+ /* Abandon RPC since get failed */
+ krx->krx_rpc_reply_needed = 0;
+ status = -ECONNABORTED;
+ }
/* free ktx & finalize() its lib_msg_t */
kqswnal_tx_done(ktx, status);
#endif
if (eprc != EP_SUCCESS) {
CERROR("ep_rpc_get failed: %d\n", eprc);
+ /* Don't attempt RPC completion:
+ * EKC nuked it when the get failed */
+ krx->krx_rpc_reply_needed = 0;
rc = -ECONNABORTED;
}
break;
krx->krx_state = KRX_PARSE;
krx->krx_rxd = rxd;
krx->krx_nob = nob;
-#if MULTIRAIL_EKC
- krx->krx_rpc_reply_needed = (status != EP_SHUTDOWN) && ep_rxd_isrpc(rxd);
-#else
- krx->krx_rpc_reply_needed = ep_rxd_isrpc(rxd);
-#endif
+
+ /* RPC reply iff rpc request received without error */
+ krx->krx_rpc_reply_needed = ep_rxd_isrpc(rxd) &&
+ (status == EP_SUCCESS ||
+ status == EP_MSG_TOO_BIG);
+
/* Default to failure if an RPC reply is requested but not handled */
krx->krx_rpc_reply_status = -EPROTO;
atomic_set (&krx->krx_refcount, 1);
kqswnal_parse (krx);
break;
case KRX_COMPLETING:
- /* Drop last ref to reply to RPC and requeue */
- LASSERT (krx->krx_rpc_reply_needed);
kqswnal_rx_decref (krx);
break;
default: