From 912fe8382d05e51b21b4a76c6e169ac145cacc19 Mon Sep 17 00:00:00 2001 From: Vitaly Fertman Date: Wed, 15 Dec 2010 02:00:07 +0300 Subject: [PATCH] b=22556 should check # of remained RPCs before aborting o=liang i=isaac lstcon_rpc_trans_postwait() calls lstcon_rpc_trans_abort() only when the transaction is timeout, so if we got "end_session" to interrupt waiting on transaction, then we can hit ASSERTION(crpc->crp_stamp != 0). --- lnet/selftest/conrpc.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lnet/selftest/conrpc.c b/lnet/selftest/conrpc.c index e376ce3c..94074ae 100644 --- a/lnet/selftest/conrpc.c +++ b/lnet/selftest/conrpc.c @@ -295,8 +295,12 @@ lstcon_rpc_trans_abort(lstcon_rpc_trans_t *trans, int error) cfs_spin_lock(&rpc->crpc_lock); - if (!crpc->crp_posted || crpc->crp_stamp != 0) { - /* rpc done or aborted already */ + if (!crpc->crp_posted || /* not posted */ + crpc->crp_stamp != 0) { /* rpc done or aborted already */ + if (crpc->crp_stamp == 0) { + crpc->crp_stamp = cfs_time_current(); + crpc->crp_status = -EINTR; + } cfs_spin_unlock(&rpc->crpc_lock); continue; } @@ -366,7 +370,7 @@ lstcon_rpc_trans_postwait(lstcon_rpc_trans_t *trans, int timeout) if (console_session.ses_shutdown) rc = -ESHUTDOWN; - if (rc != 0) { + if (rc != 0 || atomic_read(&trans->tas_remaining) != 0) { /* treat short timeout as canceled */ if (rc == -ETIMEDOUT && timeout < LST_TRANS_MIN_TIMEOUT * 2) rc = -EINTR; -- 1.8.3.1