From 5a0bf52cb5d14839cde3eeda7a18e5ddfed00b46 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Mon, 6 Jun 2011 21:06:40 +0000 Subject: [PATCH] Merge the trunk's r3546: Set data_out_in_data_receiving for preliminary completed commands as well to prevent releasing them too early in iscsi_check_tm_data_wait_timeouts() git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/2.1.0.x@3548 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- iscsi-scst/kernel/iscsi.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/iscsi-scst/kernel/iscsi.c b/iscsi-scst/kernel/iscsi.c index 81632cd84..b22e5fa04 100644 --- a/iscsi-scst/kernel/iscsi.c +++ b/iscsi-scst/kernel/iscsi.c @@ -255,7 +255,8 @@ void iscsi_fail_data_waiting_cmnd(struct iscsi_cmnd *cmnd) { TRACE_ENTRY(); - TRACE_MGMT_DBG("Failing data waiting cmnd %p", cmnd); + TRACE_MGMT_DBG("Failing data waiting cmnd %p (data_out_in_data_receiving %d)", + cmnd, cmnd->data_out_in_data_receiving); /* * There is no race with conn_abort(), since all functions @@ -2102,18 +2103,16 @@ go: if (req_hdr->flags & ISCSI_FLG_FINAL) orig_req->outstanding_r2t--; - if (unlikely(orig_req->prelim_compl_flags != 0)) { - res = iscsi_preliminary_complete(cmnd, orig_req, true); - goto out; - } - EXTRACHECKS_BUG_ON(orig_req->data_out_in_data_receiving); orig_req->data_out_in_data_receiving = 1; TRACE_WRITE("cmnd %p, orig_req %p, offset %u, datasize %u", cmnd, orig_req, offset, cmnd->pdu.datasize); - res = cmnd_prepare_recv_pdu(conn, orig_req, offset, cmnd->pdu.datasize); + if (unlikely(orig_req->prelim_compl_flags != 0)) + res = iscsi_preliminary_complete(cmnd, orig_req, true); + else + res = cmnd_prepare_recv_pdu(conn, orig_req, offset, cmnd->pdu.datasize); out: TRACE_EXIT_RES(res);