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;
}
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;