Skip to content

Commit

Permalink
[SCSI] mptsas: fixed hot-removal processing
Browse files Browse the repository at this point in the history
This patch fixes mptsas disk hot-removal processing.  The
hot-removal processing doesn't complete because of this condition.

  drivers/message/fusion/mptsas.c:
  mptsas_taskmgmt_complete()

  if ((mptsas_find_vtarget(ioc, channel, id)) && !ioc->fw_events_off)
    mptsas_queue_device_delete(...);

mptsas_queue_device_delete(), which must be called for
hot-removal, never gets called because mptsas_find_vtarget()
always returns 0 here.  At that time, the vtarget has already
been freed in mptsas_target_destroy(), and also the scsi_device
has been marked as SDEV_DEL.

As a result of the issue, port deletion functions won't get
called and the device ends up being in an incomplete state.
(Some data structures and sysfs entries, which should be
removed in hot-removal, remain.)  One side effect of this is
that a hot-addition of the device (bringing the device back
on) fails.

This patch just removes mptsas_find_vtarget() from the if-state
condition.

Signed-off-by: Kei Tokunaga <tokunaga.keiich@jp.fujitsu.com>
Acked-by: "Desai, Kashyap" <Kashyap.Desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
  • Loading branch information
Kei Tokunaga authored and James Bottomley committed Jul 27, 2010
1 parent cb237ef commit 3e84beb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/message/fusion/mptsas.c
Original file line number Diff line number Diff line change
Expand Up @@ -1261,7 +1261,7 @@ mptsas_taskmgmt_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
* enable work queue to remove device from upper layers
*/
list_del(&target_reset_list->list);
if ((mptsas_find_vtarget(ioc, channel, id)) && !ioc->fw_events_off)
if (!ioc->fw_events_off)
mptsas_queue_device_delete(ioc,
&target_reset_list->sas_event_data);

Expand Down

0 comments on commit 3e84beb

Please sign in to comment.