From a7c94a7af52b84cd92d334824a6ffd602ff98756 Mon Sep 17 00:00:00 2001 From: Peter Lieven Date: Thu, 17 Mar 2016 11:55:46 +0100 Subject: [PATCH] connect: invoke all callbacks for dropped PDUs if we drop a PDU which has a callback we should invoke it otherwise the caller may wait infinetely for a command completion. Signed-off-by: Peter Lieven --- lib/connect.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/connect.c b/lib/connect.c index 093827f..b7adb25 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -344,6 +344,10 @@ void iscsi_reconnect_cb(struct iscsi_context *iscsi _U_, int status, * All other PDUs are discarded at this point. * This includes DATA-OUT, NOP and task management. */ + if (pdu->callback) { + pdu->callback(iscsi, SCSI_STATUS_CANCELLED, + NULL, pdu->private_data); + } iscsi_free_pdu(old_iscsi, pdu); continue; }