From: Tyrel Datwyler <tyreld@linux.ibm.com>
To: james.bottomley@hansenpartnership.com, martin.petersen@oracle.com
Cc: linux-scsi@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
linux-kernel@vger.kernel.org, brking@linux.ibm.com,
davemarq@linux.ibm.com, Tyrel Datwyler <tyreld@linux.ibm.com>
Subject: [PATCH v2 00/20] scsi: ibmvfc: Fixes and cleanup for NVMe/FC support
Date: Fri, 18 Sep 2026 18:32:46 -0700 [thread overview]
Message-ID: <20260919013306.2948028-1-tyreld@linux.ibm.com> (raw)
This series addresses a collection of bugs and corner cases introduced with
the recently merged NVMe/FC support for the ibmvfc driver.
The NVMe/FC code added a parallel target management path, a new set of
sub-CRQ channels (nvme_scrqs), and integration with the nvme-fc transport
layer alongside the existing SCSI infrastructure. Several issues crept in
during that integration: missing initialisation, incorrect locking, blocking
calls in atomic context, and logic errors in shared code paths that were not
previously exercised by the SCSI-only driver.
The fixes fall into a few broad categories:
- Correctness in the NVMe FCP/LS I/O path: initialise evt->tgt, fix trace
logging reading SCSI IU fields for NVMe events, and ensure H_CLOSED send
failures call fcp_req->done() so the transport is not silently stalled.
- Locking and context fixes: defer nvme_fc_register_localport() out of the
MAD completion handler (which runs under host_lock with IRQs disabled),
and make the FCP and LS abort callbacks fully asynchronous to eliminate
blocking wait_for_completion() calls on the same path.
- Data races and UAF: protect tgt->nvme_remote_port reads and writes with
host_lock, fix a use-after-free and stall in the LS abort timeout handler,
and handle ibmvfc_send_event() failure in ibmvfc_cancel_all_mq() to
prevent a hang and UAF on queued cancel events.
- Shared-path bugs exposed by NVMe: fix an uninitialised _done dereference
for SCSI TMF events on send failure, an uninitialised shwqs stack variable
in ibmvfc_purge_requests(), a u16 overflow of max_cmds in
ibmvfc_set_login_info() reachable with combined SCSI and NVMe queue
counts, and a wrong target action in the implicit logout NULL-evt error
path that caused an infinite reset loop.
- Lifecycle and resource management: call ibmvfc_nvme_unregister() on
adapter removal and before ibmvfc_release_sub_crqs() to close a TOCTOU
race in ibmvfc_nvme_create_queue(), guard against local port leaks on
link bounce, and fix NVMe sub-queue registration failure incorrectly
disabling SCSI multiqueue.
- Concurrency in target discovery: serialise the SCSI and NVMe
discover-targets MADs so both completions have written their target counts
before ibmvfc_alloc_targets() runs.
- Minor fixes: correct an inverted suppress-ABTS capability check in the
NVMe TMF path, fix an uninitialised status variable logged on LS abort
send failure, and honour the nr_nvme_hw_queues module parameter when
sizing NVMe queues at probe time.
Changes since v1:
- Reordered patches: the discover-targets race fix (previously patch 19)
is now patch 20, and the nr_nvme_hw_queues fix (previously patch 20) is
now patch 19, to better group related fixes.
- Reworked the discover-targets fix (patch 20): replaced the pending_disc
counter approach with fully serialised discovery — the SCSI MAD is sent
first; on completion, if NVMe is active the job_step is chained to a new
ibmvfc_discover_nvme_targets() function; the NVMe MAD is only sent after
SCSI discovery has finished. This eliminates the counter corruption race
on retry and the early ALLOC_TGTS transition race without requiring any
shared state. The pending_disc bitfield is removed from ibmvfc_host.
- Updated all Fixes: tags to reference the correct upstream commit IDs as
merged into linux-next/master.
- Addressed all issues raised by Sashiko review.
Tyrel Datwyler (20):
scsi: ibmvfc: initialize evt->tgt for NVMe FCP commands
scsi: ibmvfc: fix trace logging for NVMe FCP commands
scsi: ibmvfc: complete NVMe FCP requests on H_CLOSED send failure
scsi: ibmvfc: defer NVMe local port registration out of atomic context
scsi: ibmvfc: fix uninitialized _done dereference for TMF events on
send failure
scsi: ibmvfc: fix uninitialized shwqs in ibmvfc_purge_requests()
scsi: ibmvfc: fix uninitialized status logged on LS abort send failure
scsi: ibmvfc: fix inverted suppress-ABTS capability check in NVMe TMF
path
scsi: ibmvfc: fix infinite reset loop on NULL evt in implicit logout
path
scsi: ibmvfc: fix u16 overflow of max_cmds in ibmvfc_set_login_info()
scsi: ibmvfc: fix UAF and hang in ibmvfc_cancel_all_mq() on send
failure
scsi: ibmvfc: fix data race on tgt->nvme_remote_port
scsi: ibmvfc: make NVMe FCP abort callback asynchronous
scsi: ibmvfc: fix UAF and stall in NVMe LS abort callback
scsi: ibmvfc: unregister NVMe local port on adapter removal
scsi: ibmvfc: fix NVMe local port leak on fabric link bounce
scsi: ibmvfc: fix TOCTOU race in ibmvfc_nvme_create_queue() on adapter
removal
scsi: ibmvfc: fix NVMe sub-queue registration failure disabling SCSI
multiqueue
scsi: ibmvfc: fix nr_nvme_hw_queues module parameter ignored for NVMe
queue sizing
scsi: ibmvfc: fix concurrent SCSI and NVMe discover-targets race
dropping targets
drivers/scsi/ibmvscsi/ibmvfc-core.c | 214 +++++++++++++++++++++-------
drivers/scsi/ibmvscsi/ibmvfc-nvme.c | 130 +++++++++--------
drivers/scsi/ibmvscsi/ibmvfc.h | 1 +
3 files changed, 233 insertions(+), 112 deletions(-)
--
2.55.0
next reply other threads:[~2026-09-19 1:33 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-19 1:32 Tyrel Datwyler [this message]
2026-09-19 1:32 ` [PATCH v2 01/20] scsi: ibmvfc: initialize evt->tgt for NVMe FCP commands Tyrel Datwyler
2026-09-19 1:51 ` sashiko-bot
2026-09-19 1:32 ` [PATCH v2 02/20] scsi: ibmvfc: fix trace logging " Tyrel Datwyler
2026-09-19 1:47 ` sashiko-bot
2026-09-19 1:32 ` [PATCH v2 03/20] scsi: ibmvfc: complete NVMe FCP requests on H_CLOSED send failure Tyrel Datwyler
2026-09-19 1:44 ` sashiko-bot
2026-09-19 1:32 ` [PATCH v2 04/20] scsi: ibmvfc: defer NVMe local port registration out of atomic context Tyrel Datwyler
2026-09-19 1:32 ` [PATCH v2 05/20] scsi: ibmvfc: fix uninitialized _done dereference for TMF events on send failure Tyrel Datwyler
2026-09-19 1:32 ` [PATCH v2 06/20] scsi: ibmvfc: fix uninitialized shwqs in ibmvfc_purge_requests() Tyrel Datwyler
2026-09-19 1:32 ` [PATCH v2 07/20] scsi: ibmvfc: fix uninitialized status logged on LS abort send failure Tyrel Datwyler
2026-09-19 1:32 ` [PATCH v2 08/20] scsi: ibmvfc: fix inverted suppress-ABTS capability check in NVMe TMF path Tyrel Datwyler
2026-09-19 1:32 ` [PATCH v2 09/20] scsi: ibmvfc: fix infinite reset loop on NULL evt in implicit logout path Tyrel Datwyler
2026-09-19 1:32 ` [PATCH v2 10/20] scsi: ibmvfc: fix u16 overflow of max_cmds in ibmvfc_set_login_info() Tyrel Datwyler
2026-09-19 1:32 ` [PATCH v2 11/20] scsi: ibmvfc: fix UAF and hang in ibmvfc_cancel_all_mq() on send failure Tyrel Datwyler
2026-09-19 1:32 ` [PATCH v2 12/20] scsi: ibmvfc: fix data race on tgt->nvme_remote_port Tyrel Datwyler
2026-09-19 1:32 ` [PATCH v2 13/20] scsi: ibmvfc: make NVMe FCP abort callback asynchronous Tyrel Datwyler
2026-09-19 1:33 ` [PATCH v2 14/20] scsi: ibmvfc: fix UAF and stall in NVMe LS abort callback Tyrel Datwyler
2026-09-19 1:53 ` sashiko-bot
2026-09-19 1:33 ` [PATCH v2 15/20] scsi: ibmvfc: unregister NVMe local port on adapter removal Tyrel Datwyler
2026-09-19 1:58 ` sashiko-bot
2026-09-19 1:33 ` [PATCH v2 16/20] scsi: ibmvfc: fix NVMe local port leak on fabric link bounce Tyrel Datwyler
2026-09-19 1:33 ` [PATCH v2 17/20] scsi: ibmvfc: fix TOCTOU race in ibmvfc_nvme_create_queue() on adapter removal Tyrel Datwyler
2026-09-19 1:33 ` [PATCH v2 18/20] scsi: ibmvfc: fix NVMe sub-queue registration failure disabling SCSI multiqueue Tyrel Datwyler
2026-09-19 1:33 ` [PATCH v2 19/20] scsi: ibmvfc: fix nr_nvme_hw_queues module parameter ignored for NVMe queue sizing Tyrel Datwyler
2026-09-19 1:33 ` [PATCH v2 20/20] scsi: ibmvfc: fix concurrent SCSI and NVMe discover-targets race dropping targets Tyrel Datwyler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260919013306.2948028-1-tyreld@linux.ibm.com \
--to=tyreld@linux.ibm.com \
--cc=brking@linux.ibm.com \
--cc=davemarq@linux.ibm.com \
--cc=james.bottomley@hansenpartnership.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=martin.petersen@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.