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)
committerSasha Levin <sasha.levin@oracle.com>
Wed, 19 Aug 2015 17:17:59 +0000 (13:17 -0400)
commite58bb36e35bba8f4ea1185f04ff35cc0c25c0761
tree0e4c3faf60da2e597afaf0c639e4feaea9a6e8b0
parent3fa2a2f918ccd66db81a774776dca3ebb7fcfc61
ipr: Fix locking for unit attention handling

[ Upstream commit 36b8e180e1e929e00b351c3b72aab3147fc14116 ]

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.

Cc: <stable@vger.kernel.org>
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: Sasha Levin <sasha.levin@oracle.com>
drivers/scsi/ipr.c