opnsense-src/sys/dev/nvme
Warner Losh afc3d49b17 nvme: Close a race in destroying qpair and timeouts
While we should have cleared all the pending I/O prior to calling
nvme_qpair_destroy, which should ensure that if the callout_drain causes
a call to nvme_qpair_timeout(), it won't schedule any new
timeout. However, it doesn't hurt to set timeout_pending to false in
nvme_qpair_destroy() and have nvme_qpair_timeout() exit early if it sees
it w/o scheduling a timeout. Since we don't otherwise stop the timeout
until we're about to destroy the qpair, this ensures we fail safe. The
lock/unlock also ensures the callout_drain will either remove the callout,
or wait for it to run with the early bailout.

We can likely further improve this by using callout_stop() inside the
pending lock. I'll investigate that for future refinement.

Sponsored by:		Netflix
Suggestions by:		jhb
Reviewed by:		gallatin
Differential Revision:	https://reviews.freebsd.org/D42065
2023-10-10 16:13:57 -06:00
..
nvme.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
nvme.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
nvme_ahci.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
nvme_ctrlr.c nvme: Remove stale comment 2023-10-10 16:13:56 -06:00
nvme_ctrlr_cmd.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
nvme_ns.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
nvme_ns_cmd.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
nvme_pci.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
nvme_private.h nvme: Eliminate RECOVERY_FAILED state 2023-10-10 16:13:57 -06:00
nvme_qpair.c nvme: Close a race in destroying qpair and timeouts 2023-10-10 16:13:57 -06:00
nvme_sim.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
nvme_sysctl.c nvme: Add exclusion for ISR 2023-08-25 10:11:27 -06:00
nvme_test.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
nvme_util.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00