From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 91D053438A6; Wed, 30 Sep 2026 18:06:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790791611; cv=none; b=CkeyNIR00bu1DiVp92l3WJr8oK1suEFveu3eCHfauxnYhYQ/ACsec2rPaenck/PNlSEquloKmmaEshs8csGSHDug+L5+0hjOSTkEnBW1HLGb55SZGf4qtNlmUtJf9GZbgwCdYy+k4iPSEy52dJaMVoWYgHZXU4Xszmmfrx/UhUo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790791611; c=relaxed/simple; bh=+LpwipHAWd9gXmKnwXBQspklIcIpJPmpt2a1+XsYnos=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=e1D0tdaJ9LHKUweFtmwG9rSwYhf5D+qjD4VwNfgYI3bwCRBmrDMi4XVajLGRfesNwX1oA0baUuT5gnoK+1kaZ8do7ggqdQJgnxRhVLLl0PWGFIOe5XubWkzLVkpheFhJKsFFyhps+HHblraq+Pa5iw3fzBhNvWF/gLjC0vEEBeA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=JJQoiypO; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="JJQoiypO" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E40FB1F000FF; Wed, 30 Sep 2026 18:06:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1790791610; bh=R4L3qo7iJNfi2pwjCvlybKI/dEghJPekYbC9QzAs/cE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=JJQoiypOMYo6p/gM4K8pZef/ZucJerQeBtpY2JSU2acnYDmHTTHExC110yOkIE0ES jJQxGQIABmBPW5uzdsyJn15fiC6RWiWHqkkfI3tmiCDabPj1aUrwcmvQJBS1H7eh16 Z3yh0ilvGS12MSlTyrdymMuVtTjmY4sU/Fb/o43Q= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Maurizio Lombardi , Laurence Oberman , "Martin K. Petersen (Oracle)" , Sasha Levin Subject: [PATCH 5.15 361/752] scsi: target: iscsi: Fix hang for aborted WRITE_PENDING commands Date: Wed, 30 Sep 2026 17:23:51 +0200 Message-ID: <20260930152406.092667531@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260930152358.131179731@linuxfoundation.org> References: <20260930152358.131179731@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Maurizio Lombardi [ Upstream commit d5869dae5080e976d4b03cc33eb7ceb527f242bf ] When a LUN_RESET aborts a WRITE command that is in the TRANSPORT_WRITE_PENDING state, the target core sets CMD_T_ABORTED and waits for the frontend to finish processing. If the initiator subsequently sends the remaining dataout PDUs, __iscsit_check_dataout_hdr() catches the payload, stops the dataout timer if the sequence is final and finally dumps the data. However, the iSCSI target doesn't trigger the completion process for these aborted commands. Because of this, the abort path hangs indefinitely in target_put_cmd_and_wait(), leading to a deadlocked target worker thread. Fix this by explicitly calling target_complete_cmd() when the final dataout PDU is received for an aborted WRITE command. target_complete_cmd() detects the CMD_T_ABORTED flag and cleanly routes the command into target_abort_work, allowing the abort completion to successfully unblock. Signed-off-by: Maurizio Lombardi Reviewed-by: Laurence Oberman Link: https://patch.msgid.link/20260717143828.76291-2-mlombard@redhat.com Signed-off-by: Martin K. Petersen (Oracle) Signed-off-by: Sasha Levin --- drivers/target/iscsi/iscsi_target.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c index 30b21e65779de..d77fbd66acbe3 100644 --- a/drivers/target/iscsi/iscsi_target.c +++ b/drivers/target/iscsi/iscsi_target.c @@ -1530,8 +1530,10 @@ __iscsit_check_dataout_hdr(struct iscsi_conn *conn, void *buf, */ if (se_cmd->transport_state & CMD_T_ABORTED) { if (hdr->flags & ISCSI_FLAG_CMD_FINAL && - --cmd->outstanding_r2ts < 1) + --cmd->outstanding_r2ts < 1) { iscsit_stop_dataout_timer(cmd); + target_complete_cmd(se_cmd, SAM_STAT_TASK_ABORTED); + } return iscsit_dump_data_payload(conn, payload_length, 1); } -- 2.53.0