From 8443ae6bc76153473bb7924e16c48e6967c108e0 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Fri, 29 Apr 2011 19:54:13 +0000 Subject: [PATCH] Don't abort not yet received commands git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3425 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- iscsi-scst/kernel/conn.c | 1 + iscsi-scst/kernel/nthread.c | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/iscsi-scst/kernel/conn.c b/iscsi-scst/kernel/conn.c index d6040f62f..3e112b270 100644 --- a/iscsi-scst/kernel/conn.c +++ b/iscsi-scst/kernel/conn.c @@ -650,6 +650,7 @@ again: TRACE_MGMT_DBG("Unabort not yet received cmnd %p", cmnd); clear_bit(ISCSI_CMD_ABORTED, &cmnd->prelim_compl_flags); + continue; } else if (cmnd->scst_state == ISCSI_CMD_STATE_RX_CMD) { TRACE_MGMT_DBG("Aborted cmnd %p is RX_CMD, " "keep waiting", cmnd); diff --git a/iscsi-scst/kernel/nthread.c b/iscsi-scst/kernel/nthread.c index f352b4973..76fc7f6b9 100644 --- a/iscsi-scst/kernel/nthread.c +++ b/iscsi-scst/kernel/nthread.c @@ -838,7 +838,21 @@ static int process_read_io(struct iscsi_conn *conn, int *closed) case RX_BHS: res = do_recv(conn); if (res == 0) { + /* + * Clear aborted status if this command was + * accidentally aborted with other commands of + * this connection. This command not yet + * received on the aborted time, so shouldn't be + * affected by the abort. + */ + if (cmnd->prelim_compl_flags != 0) + TRACE_MGMT_DBG("Unabort not yet " + "received cmnd %p (flags %lx)", + cmnd, cmnd->prelim_compl_flags); + cmnd->prelim_compl_flags = 0; + iscsi_cmnd_get_length(&cmnd->pdu); + if (cmnd->pdu.ahssize == 0) { if ((conn->hdigest_type & DIGEST_NONE) == 0) conn->read_state = RX_INIT_HDIGEST;