mptsas doesn't handle timeouts in mptsas_get_sata_guid()
When a SATA device is connected to an mpt_sas device the driver will try to get the SATA GUID by sending an INQUIRY command. For this to work a temporary mptsas_target_t is created that is not inserted into the target refhash. As the timeout watchdog only scans the devices in the refhash for timed out commands it is essentially blind for timeouts of that certain INQUIRY command. As a result the event handling thread of mptsas gets stuck in scsi_transport() waiting forever for the command to complete.
We found this with a certain Toshiba SATA SSD which can take 17s or even more to reply an INQUIRY on hotplug.
Updated by Hans Rosenfeld about 6 years ago
I have introduced another refhash for the temporary targets and updated the watchdog to check this refhash, too. With this change the event handling thread doesn't hang anymore.
I noticed that the device was added twice, though -- first with the WWN generated by the SAS expander, and then again by a 2nd event with it's real WWN (SATA GUID). To resolve this I changed the code to explicitly stop processing the first event if getting the SATA GUID indicates a failure (as opposed to "no GUID", which is still valid).
Updated by Electric Monk about 6 years ago
- Status changed from New to Closed
- % Done changed from 0 to 100
commit 39fd84a866206a99cbb6b6e63e0c38a367aaa88e Author: Hans Rosenfeld <firstname.lastname@example.org> Date: 2015-09-16T08:40:55.000Z 6119 mptsas doesn't handle timeouts in mptsas_get_sata_guid() Reviewed by: Josef 'Jeff' Sipek <email@example.com> Reviewed by: Gordon Ross <firstname.lastname@example.org> Reviewed by: Dan Fields <email@example.com> Reviewed by: Yuri Pankov <firstname.lastname@example.org> Reviewed by: Robert Mustacchi <email@example.com> Reviewed by: Albert Lee <firstname.lastname@example.org> Reviewed by: Garrett D'Amore <email@example.com> Approved by: Dan McDonald <firstname.lastname@example.org>