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 76EDE22A7F6; Sat, 12 Sep 2026 14:05:14 +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=1789221915; cv=none; b=KLk+TmXoKxTB3JLfSZAfK4Wv8F68xMS0ayn9Oif6nrtTxT01S/1EAA9lSrIz5R8OPt520u5oewqyFo3JK0Hifgoj8I93+mhnRMexR2XCX9gVJDxECTgQwK1kg6fvMJETtzNGYJFcT84iCCGxLnJiCUJ8gkSk1HgwDqpuRrF7AFs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789221915; c=relaxed/simple; bh=zVn7D7eTKUKrFe2msBvGzwJV8mV0DlrOhPhdpw3/PSE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jqolkKXOMaBQTZ8NVxCtRfZ8WlzhODlp+89L+hKZNsxeLjqqtmPXww2AOh3kpmQkJYME9TdFwu8xkgDzR9HU0XBYQi8D2ntRXT3BXi/B+5NpTPwfJR9vfhRkaNqwAEl75tP30Yh4w4jjfHDoTVkWZbEvOBGJgDwwbq86Jl8Dub0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ASVPEBaG; 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="ASVPEBaG" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 18AF81F000FF; Sat, 12 Sep 2026 14:05:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789221914; bh=wle+dGBadmtQ/j/VxKUqH2/5i5LyROmgpLgUJQ40uWE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ASVPEBaGBwik6fNkMZTTJtsTEv0LPKqYSb1st0Vqt78QLmqAg4w3Id6JMp6XzrZSK TavB+IwyYwQm/+ISfuQqYOcg6lXKF8U/QSRU+Ns1LTrTl7FSaQ94xpsdzN6y37uOLI poh0WQ1UYDTriadlJARtX9YjYb9Cyhzc2LSqtIYE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Nilesh Javali , Hannes Reinecke , "Martin K. Petersen (Oracle)" Subject: [PATCH 6.6 0478/1424] scsi: qla2xxx: Initialize NVMe abort_work once at submission Date: Sat, 12 Sep 2026 08:48:30 +0200 Message-ID: <20260912065617.990261995@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065607.279695368@linuxfoundation.org> References: <20260912065607.279695368@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 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Nilesh Javali commit 7e85f6dbc85616de2172bce8eaf84b387a723cd1 upstream. 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. Fixes: e473b3074104 ("scsi: qla2xxx: Add FC-NVMe abort processing") Cc: stable@vger.kernel.org Signed-off-by: Nilesh Javali Reviewed-by: Hannes Reinecke Link: https://patch.msgid.link/20260723050413.3897522-52-njavali@marvell.com Signed-off-by: Martin K. Petersen (Oracle) Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/qla2xxx/qla_nvme.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/scsi/qla2xxx/qla_nvme.c +++ b/drivers/scsi/qla2xxx/qla_nvme.c @@ -464,7 +464,6 @@ static void qla_nvme_ls_abort(struct nvm } spin_unlock_irqrestore(&priv->cmd_lock, flags); - INIT_WORK(&priv->abort_work, qla_nvme_abort_work); schedule_work(&priv->abort_work); } @@ -502,6 +501,7 @@ static int qla_nvme_ls_req(struct nvme_f 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; @@ -546,7 +546,6 @@ static void qla_nvme_fcp_abort(struct nv } spin_unlock_irqrestore(&priv->cmd_lock, flags); - INIT_WORK(&priv->abort_work, qla_nvme_abort_work); schedule_work(&priv->abort_work); } @@ -812,6 +811,7 @@ static int qla_nvme_post_cmd(struct nvme 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;