FAILED: patch "[PATCH] scsi: qla2xxx: Initialize NVMe abort_work once at submission" failed to apply to 6.1-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 6.1-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 <[email protected]>.
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.1.y
git checkout FETCH_HEAD
git cherry-pick -x 7e85f6dbc85616de2172bce8eaf84b387a723cd1
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026090908-emblaze-startup-caf3@gregkh' --subject-prefix 'PATCH 6.1.y' 'HEAD^..'
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 7e85f6dbc85616de2172bce8eaf84b387a723cd1 Mon Sep 17 00:00:00 2001
From: Nilesh Javali <[email protected]>
Date: Thu, 23 Jul 2026 10:34:08 +0530
Subject: [PATCH] scsi: qla2xxx: Initialize NVMe abort_work once at submission
qla_nvme_fcp_abort() and qla_nvme_ls_abort() ran INIT_WORK() on priv->abort_work immediately before schedule_work(). INIT_WORK() reinitializes the work_struct, resetting its list head and clearing the pending bit. If an abort is issued more than once for the same command (for example, concurrent transport teardown and a timeout-driven abort), the second INIT_WORK() reinitializes a work item that is already queued, which can corrupt the workqueue list and lead to crashes or a looping worker.
Initialize priv->abort_work once at command submission, next to the existing per-command spin_lock_init(&priv->cmd_lock), and leave only schedule_work() in the abort paths. schedule_work() already does nothing when the work item is still pending, so a repeated abort no longer disturbs an in-flight work item. The command is not returned to the transport until the final kref_put()/release callback runs after abort_work has completed, so the work item is idle before priv is reused and the single submission-time INIT_WORK() is safe.
drivers/scsi/qla2xxx/qla_nvme.c +2 -2
@@ -463,7 +463,6 @@ static void qla_nvme_ls_abort(struct nvme_fc_local_port *lport, }spin_unlock_irqrestore (&priv->cmd_lock, flags); -INIT_WORK (&priv->abort_work, qla_nvme_abort_work);schedule_work (&priv->abort_work); }
@@ -501,6 +500,7 @@ static int qla_nvme_ls_req(struct nvme_fc_local_port *lport, priv->sp = sp;kref_init (&sp->cmd_kref);spin_lock_init (&priv->cmd_lock); +INIT_WORK (&priv->abort_work, qla_nvme_abort_work); nvme = &sp->u.iocb_cmd; priv->fd = fd; nvme->u.nvme.desc = fd;
@@ -545,7 +545,6 @@ static void qla_nvme_fcp_abort(struct nvme_fc_local_port *lport, }spin_unlock_irqrestore (&priv->cmd_lock, flags); -INIT_WORK (&priv->abort_work, qla_nvme_abort_work);schedule_work (&priv->abort_work); }
@@ -877,6 +876,7 @@ static int qla_nvme_post_cmd(struct nvme_fc_local_port *lport,kref_init (&sp->cmd_kref);spin_lock_init (&priv->cmd_lock); +INIT_WORK (&priv->abort_work, qla_nvme_abort_work); sp->priv = priv; priv->sp = sp; sp->type =SRB_NVME_CMD ;
Sasha Levin
maintainerPATCH 1/1 scsi: qla2xxx: Initialize NVMe abort_work once at submission
From: Nilesh Javali <[email protected]>
[ Upstream commit 7e85f6dbc85616de2172bce8eaf84b387a723cd1 ]
qla_nvme_fcp_abort() and qla_nvme_ls_abort() ran INIT_WORK() on priv->abort_work immediately before schedule_work(). INIT_WORK() reinitializes the work_struct, resetting its list head and clearing the pending bit. If an abort is issued more than once for the same command (for example, concurrent transport teardown and a timeout-driven abort), the second INIT_WORK() reinitializes a work item that is already queued, which can corrupt the workqueue list and lead to crashes or a looping worker.
Initialize priv->abort_work once at command submission, next to the existing per-command spin_lock_init(&priv->cmd_lock), and leave only schedule_work() in the abort paths. schedule_work() already does nothing when the work item is still pending, so a repeated abort no longer disturbs an in-flight work item. The command is not returned to the transport until the final kref_put()/release callback runs after abort_work has completed, so the work item is idle before priv is reused and the single submission-time INIT_WORK() is safe.
--- drivers/scsi/qla2xxx/qla_nvme.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/qla2xxx/qla_nvme.c +2 -2
@@ -309,7 +309,6 @@ static void qla_nvme_ls_abort(struct nvme_fc_local_port *lport, }spin_unlock_irqrestore (&priv->cmd_lock, flags); -INIT_WORK (&priv->abort_work, qla_nvme_abort_work);schedule_work (&priv->abort_work); }
@@ -347,6 +346,7 @@ static int qla_nvme_ls_req(struct nvme_fc_local_port *lport, priv->sp = sp;kref_init (&sp->cmd_kref);spin_lock_init (&priv->cmd_lock); +INIT_WORK (&priv->abort_work, qla_nvme_abort_work); nvme = &sp->u.iocb_cmd; priv->fd = fd; nvme->u.nvme.desc = fd;
@@ -391,7 +391,6 @@ static void qla_nvme_fcp_abort(struct nvme_fc_local_port *lport, }spin_unlock_irqrestore (&priv->cmd_lock, flags); -INIT_WORK (&priv->abort_work, qla_nvme_abort_work);schedule_work (&priv->abort_work); }
@@ -657,6 +656,7 @@ static int qla_nvme_post_cmd(struct nvme_fc_local_port *lport,kref_init (&sp->cmd_kref);spin_lock_init (&priv->cmd_lock); +INIT_WORK (&priv->abort_work, qla_nvme_abort_work); sp->priv = priv; priv->sp = sp; sp->type =SRB_NVME_CMD ;
Signature · 1 line
2.53.0