X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lnet%2Fselftest%2Fconrpc.c;h=c7c9d4cdb2c2fe7d364bf462e07760d9ee9ad65d;hb=65701b4a30efdb695776bcf690a2b3cabc928da1;hp=e376ce3c5d99192aba372f64022ce313a1369f7d;hpb=f95393b0d0a59cf3dc2f29cffc35dcc4cc9d7728;p=fs%2Flustre-release.git diff --git a/lnet/selftest/conrpc.c b/lnet/selftest/conrpc.c index e376ce3c..c7c9d4c 100644 --- a/lnet/selftest/conrpc.c +++ b/lnet/selftest/conrpc.c @@ -28,6 +28,8 @@ /* * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. + * + * Copyright (c) 2011, Whamcloud, Inc. */ /* * This file is part of Lustre, http://www.lustre.org/ @@ -295,8 +297,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 +372,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; @@ -423,7 +429,6 @@ void lstcon_rpc_trans_stat(lstcon_rpc_trans_t *trans, lstcon_trans_stat_t *stat) { lstcon_rpc_t *crpc; - srpc_client_rpc_t *rpc; srpc_msg_t *rep; int error; @@ -435,8 +440,6 @@ lstcon_rpc_trans_stat(lstcon_rpc_trans_t *trans, lstcon_trans_stat_t *stat) lstcon_rpc_t, crp_link) { lstcon_rpc_stat_total(stat, 1); - rpc = crpc->crp_rpc; - LASSERT (crpc->crp_stamp != 0); error = lstcon_rpc_get_reply(crpc, &rep); @@ -474,7 +477,6 @@ lstcon_rpc_trans_interpreter(lstcon_rpc_trans_t *trans, cfs_list_t *next; lstcon_rpc_ent_t *ent; srpc_generic_reply_t *rep; - srpc_client_rpc_t *rpc; lstcon_rpc_t *crpc; srpc_msg_t *msg; lstcon_node_t *nd; @@ -499,8 +501,6 @@ lstcon_rpc_trans_interpreter(lstcon_rpc_trans_t *trans, ent = cfs_list_entry(next, lstcon_rpc_ent_t, rpe_link); - rpc = crpc->crp_rpc; - LASSERT (crpc->crp_stamp != 0); error = lstcon_rpc_get_reply(crpc, &msg);