[PATCH v3 0/2] scsi: mpt3sas: Fix delayed not-responding sdev block handling
From: Jeff Layton
Date: Fri Nov 06 2026 - 15:30:10 EST
v3 fixes a yet more issues that Sashiko pointed out.
This fix is for a deadlock that we see regularly in Meta's fleet. The
idea is to break the deadlock by unblocking sdevs after a timeout.
I don't do a lot of SCSI driver work, but this one fell in my lap. I
leaned heavily on agentic help for this series.
If this looks good, it'd be nice to see this in linux-next soon.
Thanks,
Jeff
Signed-off-by: Jeff Layton <jlayton@xxxxxxxxxx>
---
Changes in v3:
- Patch 1: publish sdev->hostdata under ioc->block_lock in
scsih_sdev_init(), so the interrupt-time block can't see it before
its sas_target store
- Clear block_deadline on all affected sdevs, under ioc->block_lock,
before the fw event worker starts TUR polling, not per-sdev mid-poll
- Take ioc->block_lock in _scsih_block_io_all_device() and clear
block_deadline on already-blocked sdevs, so dnr_unblock_work can't
unblock them during broadcast primitive TM
- Defer dnr_unblock_work while scsi_host_in_recovery(), and use
mod_delayed_work() for the retry
- Link to v2: https://lore.kernel.org/r/20261102-sas-abba-v2-0-b3b9ba874b5a@xxxxxxxxxx
Changes in v2:
- New patch 1: serialize the interrupt-time sdev block with hostdata
teardown in scsih_sdev_destroy() via new ioc->block_lock (fixes a
pre-existing UAF)
- Do the timed unblock under ioc->block_lock, so it can't race with an
interrupt-time block
- Clear block_deadline before the fw event worker polls a returning
device with TURs, so dnr_unblock_work can't unblock it mid-poll
- Link to v1: https://lore.kernel.org/r/20261030-sas-abba-v1-1-b8cdd714a37c@xxxxxxxxxx
---
Jeff Layton (2):
scsi: mpt3sas: Serialize interrupt-time sdev block with hostdata teardown
scsi: mpt3sas: Time out delayed not-responding device blocks
drivers/scsi/mpt3sas/mpt3sas_base.c | 13 ++
drivers/scsi/mpt3sas/mpt3sas_base.h | 10 ++
drivers/scsi/mpt3sas/mpt3sas_scsih.c | 245 ++++++++++++++++++++++++++++++++---
3 files changed, 247 insertions(+), 21 deletions(-)
---
base-commit: 8b7179210b22f8e48a82c5ceacb9d56a9c4cfec4
change-id: 20261030-sas-abba-eacfcc45fe36
Best regards,
--
Jeff Layton <jlayton@xxxxxxxxxx>