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 9FCD947A893; Sat, 12 Sep 2026 11:52:37 +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=1789213961; cv=none; b=r/+W0eiyLpoTXuOnAmTJZmyP7xxHlmfYDsrPjux2N3cQzp0tHjul82tJN7vhTRXtkLiZZUvkVvD/1WPQBmuIsJGKkm8id97Ya2E9cvYBxdhK2+ufgtbCK6HaiKfbJvOvwhR6k1MizRFSuoGIJQEoGpsXfE3vOzaNkoXTu1b7D70= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789213961; c=relaxed/simple; bh=xvF9AJIyo4trAZYEuoUSwkUQ7X0H75xbjg5WLSlld8g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Zv3CKdPmZjPFg4szdbnR2Gut6SmF76FVat8eqG5UgjTFQkNTR+DqE9aZA12riaFIggoxcrzWcXHWAtoV9YcySQuh1D9pLeCwgCx2g/qHvDfDXHTsuzoVJNE+CWpN8ZxLfs7HzEn0+pznt6VNweRGJTY5QgMsr5akV9X7bmwRLnQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Ali9o7bl; 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="Ali9o7bl" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1BB161F000FF; Sat, 12 Sep 2026 11:52:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789213955; bh=glmGv9t6hkoSN2sjrw2RdK5X4Xtb+1mhxRa+PM2H/CU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Ali9o7bl5Mf46K/WVm0sZbQMByqElCdrvnB/mtj95mg4HhVZCQI3hAlEvBF6kUKog h4C7wdeROiT3YXDx2fN//LdVGF/N5KQA2nNtofDe6256WgFN8aWoPmc1Ion/54gX3V 6DCBT0/keA4Ip50gEVvqpHpF1qPSg2hXpSk5DMqA= 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.12 0225/1376] scsi: qla2xxx: Initialize NVMe abort_work once at submission Date: Sat, 12 Sep 2026 08:44:11 +0200 Message-ID: <20260912065612.562459373@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065607.535295758@linuxfoundation.org> References: <20260912065607.535295758@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.12-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 @@ -463,7 +463,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); } @@ -501,6 +500,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; @@ -545,7 +545,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); } @@ -811,6 +810,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;