From: Liang Zhen Date: Wed, 7 Apr 2010 10:04:08 +0000 (+0200) Subject: b=22556 lst: check # of remained RPCs before aborting X-Git-Tag: 1.8.3~7 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=0d762f889093666d70d64b4e74692a88531d4cf2;p=fs%2Flustre-release.git b=22556 lst: check # of remained RPCs before aborting 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 the assertion failure ASSERTION(crpc->crp_stamp != 0) --- diff --git a/lnet/selftest/conrpc.c b/lnet/selftest/conrpc.c index 3b2fb75..e629ba3 100644 --- a/lnet/selftest/conrpc.c +++ b/lnet/selftest/conrpc.c @@ -292,8 +292,12 @@ lstcon_rpc_trans_abort(lstcon_rpc_trans_t *trans, int error) 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; + } spin_unlock(&rpc->crpc_lock); continue; } @@ -362,7 +366,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;