From nobody Thu Apr 2 23:54:50 2026 Received: from mail-dl1-f45.google.com (mail-dl1-f45.google.com [74.125.82.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7D882221F26 for ; Sat, 14 Feb 2026 04:28:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771043320; cv=none; b=JlB9stOXXe5vvmX8HBvRmRDqj3ACqyoN16nsykQ63fD7ItPcGaDibMZ2LLGPHVQDKDoUHBED7nPNgW0RmZ1K58my+igfPM+DajN45wjre+auVjAG4HZ5+B+sZIltcIDVoIq2r/eyjgc3kLnjTTw4O02evuQAmpK8nsVNSEp6Plk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771043320; c=relaxed/simple; bh=0udHID5KL61Xx3Y6ZYYZn5XQ2+6n6XT/3Rp742TCj2w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=p/ww32mJ6OI8M6zUoeLCVJjIKy5j1NKSvcAfyeCiKr9wpE1rE5Hr03/SZLbohztSzlxOMMMfU88ocqBFNacxdq2R3h8tvl9KW8WY7Lfcaf+0nDM0bktEkkcL+DcGa03pa7qXH7xKSTHgNWdkpcK5yULwB7IJMx5AQBT0Vd7fs+g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=purestorage.com; spf=fail smtp.mailfrom=purestorage.com; dkim=pass (2048-bit key) header.d=purestorage.com header.i=@purestorage.com header.b=QGS4NuGY; arc=none smtp.client-ip=74.125.82.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=purestorage.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=purestorage.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=purestorage.com header.i=@purestorage.com header.b="QGS4NuGY" Received: by mail-dl1-f45.google.com with SMTP id a92af1059eb24-1248d27f293so3710907c88.0 for ; Fri, 13 Feb 2026 20:28:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=purestorage.com; s=google2022; t=1771043314; x=1771648114; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ekotz5RVjYf6MGMkCCi7bJt1PcW5y5lDCPYdfqHxyyw=; b=QGS4NuGYnxjIdCdjDu/nIQT6h7fddWIXK3QUMYdiMRWlawTYF+NckyxFg1M+/2tuFY DdYLCVA31C+SCTA9cXgMTpgfEVHwjxETRr3U9BlLCNNC9aVq/+8xLBFU5tbpQ6w5JF5C iX//lWkpxADIo4JsV7OiSJqEjcdYP+xJnmkkqIVBt6I/9kc4O7eR/mxkjTSQldLzw6Iv LT4d16X8q95XhmdooY38jHoCzk5VhSDphYlu2dNRxsdtpb2wW/Umvw4Sw8MICCEOnoQD me0qzlPxsuepeTzYfTnzF1cy+MLU5hL4V1bwWgDI6OaOrf+Dtk9jwRwRRCMQflM684Kk 5Stw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771043314; x=1771648114; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=ekotz5RVjYf6MGMkCCi7bJt1PcW5y5lDCPYdfqHxyyw=; b=E4ZuQDFg2xUtexfCusRagb9REVwVV73m6iVFbpn7WgsZnjKV5HmzgOAzPMvZzEkwVv hrHGzMdxQ0d3AZUggRYQC6Tt3jN0Oqoo2CviylJmulGAV29gbc1OzpfbCcEiAKHBRoAO mzObjFQxJZ/s7wWLoivcbs4FgWy0F05NRlGNx+b4l3mDSFiP0o3cyVEJEnkK/snewo+s egPH48TlzJUZgFAFgOUJf0QvikvVV7wWLtq2cbBF4kJMaoMumQUEffIdbKRpiJYKIFrO y578YeKeqKvidKfOJVLXln32ZKg8hScoZahzzlrvTeRBAhhjMYx96KsnfZX014ph0TNm FE9w== X-Forwarded-Encrypted: i=1; AJvYcCWhfVXHOxl2uqKLuuzNta6vWYdO+6fweR09tpEpZ80EEaW73Oq7cbHLKDDcNov/U28IOssYtKXbe0XPafM=@vger.kernel.org X-Gm-Message-State: AOJu0YwYZtHdC64nT6EdeBZn1CicDYg/BDVm1PnYubb3Iy/MFgnuMc0q xpdG6MAiUVdQMYFqbhjUlHoEH7rKyBp95oI1SGALMfD5RYcGiZR6UiOSkz6CkvlkyKo= X-Gm-Gg: AZuq6aJpDV/+lOU+n6Wu3UnNM7vmz5/95HLDFEdnxM2G8L2A2CdrRcN3z427n2LjT3C 1YdA2zpvr5AK2cbv9t8aTEf3GwJDv0xTh3T37CSllQryS+cqj/1q0L7AqRjHGsGD6CueATNg5p/ rgw6mS09UkS6CNZ+T+4Dn9sKkB1KWYvtrHkSyPV98j5nv1066DkVgsnHyED6oHWCWgO6IBbvWuR SZihYy17SY+WVCS8eG6T5datKWL1pk5qOpnpA2GqT/4k7gwWTaPBxwLujbXBILb6jv41x96rueP WKtP38bVS+F6bSF3laPnz1R4UEcjiaHKbWlkOGAu67p4AJAtm8XYmRusaQJdSfbBJ7F6leiyhvl m5btALabWc+HS+BvIsD6wUiClE1eQeh5arqPUUN0c31vqAZFSHyxYfdtfEBPHqjciQrJ9lGXp+k Ag8c2ySmci1624MnB3bpae93G29OVGPH0sEw2JRLJhFVWS2A== X-Received: by 2002:a05:7022:e1e:b0:11b:9386:7ed3 with SMTP id a92af1059eb24-1273aed4989mr2119761c88.48.1771043313356; Fri, 13 Feb 2026 20:28:33 -0800 (PST) Received: from apollo.purestorage.com ([208.88.152.253]) by smtp.googlemail.com with ESMTPSA id a92af1059eb24-12742cbc900sm1021042c88.14.2026.02.13.20.28.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Feb 2026 20:28:33 -0800 (PST) From: Mohamed Khalfella To: Justin Tee , Naresh Gottumukkala , Paul Ely , Chaitanya Kulkarni , Christoph Hellwig , Jens Axboe , Keith Busch , Sagi Grimberg , James Smart , Hannes Reinecke Cc: Aaron Dailey , Randy Jennings , Dhaval Giani , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, Mohamed Khalfella Subject: [PATCH v3 15/21] nvme-fc: Do not cancel requests in io taget before it is initialized Date: Fri, 13 Feb 2026 20:25:16 -0800 Message-ID: <20260214042753.4073668-16-mkhalfella@purestorage.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260214042753.4073668-1-mkhalfella@purestorage.com> References: <20260214042753.4073668-1-mkhalfella@purestorage.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" A new nvme-fc controller in CONNECTING state sees admin request timeout schedules ctrl->ioerr_work to abort inflight requests. This ends up calling __nvme_fc_abort_outstanding_ios() which aborts requests in both admin and io tagsets. In case fc_ctrl->tag_set was not initialized we see the warning below. This is because ctrl.queue_count is initialized early in nvme_fc_alloc_ctrl(). nvme nvme0: NVME-FC{0}: starting error recovery Connectivity Loss INFO: trying to register non-static key. The code is fine but needs lockdep annotation, or maybe lpfc 0000:ab:00.0: queue 0 connect admin queue failed (-6). you didn't initialize this object before use? turning off the locking correctness validator. Workqueue: nvme-reset-wq nvme_fc_ctrl_ioerr_work [nvme_fc] Call Trace: dump_stack_lvl+0x57/0x80 register_lock_class+0x567/0x580 __lock_acquire+0x330/0xb90 lock_acquire.part.0+0xad/0x210 blk_mq_tagset_busy_iter+0xf9/0xc00 __nvme_fc_abort_outstanding_ios+0x23f/0x320 [nvme_fc] nvme_fc_ctrl_ioerr_work+0x172/0x210 [nvme_fc] process_one_work+0x82c/0x1450 worker_thread+0x5ee/0xfd0 kthread+0x3a0/0x750 ret_from_fork+0x439/0x670 ret_from_fork_asm+0x1a/0x30 Update the check in __nvme_fc_abort_outstanding_ios() confirm that io tagset was created before iterating over busy requests. Also make sure to cancel ctrl->ioerr_work before removing io tagset. Signed-off-by: Mohamed Khalfella --- drivers/nvme/host/fc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c index e605dd3f4a40..eac3a7ccaa5c 100644 --- a/drivers/nvme/host/fc.c +++ b/drivers/nvme/host/fc.c @@ -2557,7 +2557,7 @@ __nvme_fc_abort_outstanding_ios(struct nvme_fc_ctrl *= ctrl, bool start_queues) * io requests back to the block layer as part of normal completions * (but with error status). */ - if (ctrl->ctrl.queue_count > 1) { + if (ctrl->ctrl.queue_count > 1 && ctrl->ctrl.tagset) { nvme_quiesce_io_queues(&ctrl->ctrl); nvme_sync_io_queues(&ctrl->ctrl); blk_mq_tagset_busy_iter(&ctrl->tag_set, @@ -2954,6 +2954,11 @@ nvme_fc_create_io_queues(struct nvme_fc_ctrl *ctrl) out_delete_hw_queues: nvme_fc_delete_hw_io_queues(ctrl); out_cleanup_tagset: + /* + * In CONNECTING state ctrl->ioerr_work will abort both admin + * and io tagsets. Cancel it first before removing io tagset. + */ + cancel_work_sync(&ctrl->ioerr_work); nvme_remove_io_tag_set(&ctrl->ctrl); nvme_fc_free_io_queues(ctrl); =20 --=20 2.52.0