From 8a09beb37de51fc2d1896ccf8dadc9e3ad7ff8b3 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Mon, 9 Nov 2015 19:19:41 +0000 Subject: [PATCH] isert-scst: Fix isert conn tx_free_list resources leak The get and put of resources from the tx_free commands pool was not symmetric. Commands that are self issued by the target (e.g. nop outs) didn't release their resources, although they acquired them earlier. Signed-off-by: Ariel Nahum Signed-off-by: Alex Lyakas git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6630 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- iscsi-scst/kernel/isert-scst/iser_datamover.c | 3 +-- iscsi-scst/kernel/isert-scst/isert.c | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iscsi-scst/kernel/isert-scst/iser_datamover.c b/iscsi-scst/kernel/isert-scst/iser_datamover.c index 4b0c287bc..fbb119c6d 100644 --- a/iscsi-scst/kernel/isert-scst/iser_datamover.c +++ b/iscsi-scst/kernel/isert-scst/iser_datamover.c @@ -168,8 +168,7 @@ void isert_release_rx_pdu(struct iscsi_cmnd *iscsi_pdu) { struct isert_cmnd *isert_pdu = (struct isert_cmnd *)iscsi_pdu; - if (likely(!isert_pdu->is_fake_rx)) - isert_rx_pdu_done(isert_pdu); + isert_rx_pdu_done(isert_pdu); } /* if last transition into FF (Fully Featured) state */ diff --git a/iscsi-scst/kernel/isert-scst/isert.c b/iscsi-scst/kernel/isert-scst/isert.c index a8a382ca2..3d81e52c6 100644 --- a/iscsi-scst/kernel/isert-scst/isert.c +++ b/iscsi-scst/kernel/isert-scst/isert.c @@ -46,6 +46,7 @@ #endif #include "isert_dbg.h" #include "isert.h" +#include "iser.h" #include "iser_datamover.h" #if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING) @@ -211,7 +212,7 @@ static void isert_cmnd_free(struct iscsi_cmnd *cmnd) sBUG(); } #endif - if (cmnd->parent_req) + if (cmnd->parent_req || ((struct isert_cmnd *)cmnd)->is_fake_rx) isert_release_tx_pdu(cmnd); else isert_release_rx_pdu(cmnd);