ipr: Fix locking for unit attention handling
authorBrian King <brking@linux.vnet.ibm.com>
Tue, 14 Jul 2015 16:41:29 +0000 (11:41 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 17 Aug 2015 03:51:36 +0000 (20:51 -0700)
commitec8ea7c221488d7e6a05a34e2f9fafab6f39c976
treef4516032e83420d17fe4a4441987418b3f5cff21
parent2f1a904ec548e48e7daa7b54fe18664d5a7e0d44
ipr: Fix locking for unit attention handling

commit 36b8e180e1e929e00b351c3b72aab3147fc14116 upstream.

Make sure we have the host lock held when calling scsi_report_bus_reset. Fixes
a crash seen as the __devices list in the scsi host was changing as we were
iterating through it.

Reviewed-by: Wen Xiong <wenxiong@linux.vnet.ibm.com>
Reviewed-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/scsi/ipr.c