Project

General

Profile

Actions

Bug #5297

closed

mptsas refhash replacement on reset can cause hang

Added by Rich Ercolani almost 7 years ago. Updated almost 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Start date:
2014-11-07
Due date:
% Done:

100%

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

Description

Want to integrate the one outstanding bugfix in the SmartOS tree for mpt_sas that hasn't made it upstream.

The relevant commit can be found at https://github.com/joyent/illumos-joyent/commit/d8b8daca0baacf10f4535dddb56338d0afc3b335; I'll try to ask il-dev to review a (basically unmodified) respin of the patch against il-gate HEAD, and then kick it off for RTI.

To verbatim copy from its bug report (in the event that one of these becomes unavailable before the other):

From Zhiwen Zhang:

> The scenario may be the following:
> 
> During mptsas_restart_ioc(), we already hold mpt->m_mutex and
> mpt->m_in_reset set to TRUE,
> so new commands cannot be added to active queue and wait queue, but can be
> added to tx wait queue,
> which does not require to hold mpt->m_mutex to be manipulated. So during
> ioc restart, the mptsas_target_t s
> can still be actively used, e.g. cmd->cmd_tgt_addr = ptgt in
> mptsas_scsi_init_pkt().

The IOC reset path does not need to replace the refhash. In addition to causing a memory leak, this approach leads to potential hangs in the case described above. Instead, we should allocate this once in the attach path and then leave it alone.

Actions

Also available in: Atom PDF