Project

General

Profile

Bug #6119

mptsas doesn't handle timeouts in mptsas_get_sata_guid()

Added by Hans Rosenfeld about 5 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Normal
Category:
driver - device drivers
Start date:
2015-08-12
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:

Description

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.

History

#1

Updated by Hans Rosenfeld about 5 years ago

Webrev: http://ma.nexenta.com/~woodstock/illumos-6119/

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).

#2

Updated by Electric Monk about 5 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit 39fd84a866206a99cbb6b6e63e0c38a367aaa88e

commit  39fd84a866206a99cbb6b6e63e0c38a367aaa88e
Author: Hans Rosenfeld <hans.rosenfeld@nexenta.com>
Date:   2015-09-16T08:40:55.000Z

    6119 mptsas doesn't handle timeouts in mptsas_get_sata_guid()
    Reviewed by: Josef 'Jeff' Sipek <josef.sipek@nexenta.com>
    Reviewed by: Gordon Ross <gordon.ross@nexenta.com>
    Reviewed by: Dan Fields <dan.fields@nexenta.com>
    Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
    Reviewed by: Robert Mustacchi <rm@joyent.com>
    Reviewed by: Albert Lee <trisk@omniti.com>
    Reviewed by: Garrett D'Amore <garrett@damore.org>
    Approved by: Dan McDonald <danmcd@omniti.com>

Also available in: Atom PDF