From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 D5B9E3A3E96 for ; Mon, 30 Mar 2026 09:38:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774863492; cv=none; b=cka8MVe+FCjle2R4fajbKk3st3mw8mbQ5Q4J+GInETPBU8S9BU9AprBg4uShMvxRKpKEQJG5JQfn9KuSSBMHQW15iBzXM8dNgXOlHKyP1xEbd9Zt9x1Zyf+j5aDY3i68I0jhm06WouunrRn5W5dt05CXOM9rnHUMIZsJeFd0pyM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774863492; c=relaxed/simple; bh=adLi4cGGXXJB/gBjwi48qK0O5rWJ/QyLjPT93sOvrsI=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=bYrihDFir/qfLlXdvbzt+FzlaSlJHQOlNbXdls96qHNVfpEn9aTgRInE0sdQwk6KdR4/WhUPkB8dKeEhF3CIIQ14tHX2UgSSpAJNCpul/yvXVSRH8PzCLgD3/PLFWpVt07SCNIzkGMqpY9LMJEvAhI5ugIJCUtwAnWDaIZSiMOo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=wGgDeSKj; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="wGgDeSKj" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 333ECC4CEF7; Mon, 30 Mar 2026 09:38:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1774863492; bh=adLi4cGGXXJB/gBjwi48qK0O5rWJ/QyLjPT93sOvrsI=; h=Subject:To:Cc:From:Date:From; b=wGgDeSKjnDLhb4L+Gr5FG75RSgns4B4OMekenW19PPkccwaWkTanQS1MNO+BHmx5E BI1w1yTP5TO3zCksgd/2D/LlHqJe5zHJ3HziCn5+Mapt3pw29iCZJ+LocTPtZ+uoc1 ubbSI/fFH3zm8W6bWA53esqL4kUrQiTko5/ov9FY= Subject: FAILED: patch "[PATCH] scsi: target: file: Use kzalloc_flex for aio_cmd" failed to apply to 6.18-stable tree To: Thinh.Nguyen@synopsys.com,martin.petersen@oracle.com Cc: From: Date: Mon, 30 Mar 2026 11:38:02 +0200 Message-ID: <2026033002-suave-karma-46c8@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.18-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.18.y git checkout FETCH_HEAD git cherry-pick -x 01f784fc9d0ab2a6dac45ee443620e517cb2a19b # git commit -s git send-email --to '' --in-reply-to '2026033002-suave-karma-46c8@gregkh' --subject-prefix 'PATCH 6.18.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 01f784fc9d0ab2a6dac45ee443620e517cb2a19b Mon Sep 17 00:00:00 2001 From: Thinh Nguyen Date: Sat, 14 Mar 2026 01:17:40 +0000 Subject: [PATCH] scsi: target: file: Use kzalloc_flex for aio_cmd The target_core_file doesn't initialize the aio_cmd->iocb for the ki_write_stream. When a write command fd_execute_rw_aio() is executed, we may get a bogus ki_write_stream value, causing unintended write failure status when checking iocb->ki_write_stream > max_write_streams in the block device. Let's just use kzalloc_flex when allocating the aio_cmd and let ki_write_stream=0 to fix this issue. Fixes: 732f25a2895a ("fs: add a write stream field to the kiocb") Fixes: c27683da6406 ("block: expose write streams for block device nodes") Cc: stable@vger.kernel.org Signed-off-by: Thinh Nguyen Link: https://patch.msgid.link/f1a2f81c62f043e31f80bb92d5f29893400c8ee2.1773450782.git.Thinh.Nguyen@synopsys.com Signed-off-by: Martin K. Petersen diff --git a/drivers/target/target_core_file.c b/drivers/target/target_core_file.c index 3ae1f7137d9d..3d593af30aa5 100644 --- a/drivers/target/target_core_file.c +++ b/drivers/target/target_core_file.c @@ -276,7 +276,7 @@ fd_execute_rw_aio(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents, ssize_t len = 0; int ret = 0, i; - aio_cmd = kmalloc_flex(*aio_cmd, bvecs, sgl_nents); + aio_cmd = kzalloc_flex(*aio_cmd, bvecs, sgl_nents); if (!aio_cmd) return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE;