aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-12-30 17:31:30 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2017-12-30 17:31:30 -0500
commit71ee203389f7cb1c1927eab22b95baa01405791c (patch)
tree7f057e8c8ba4c2e735608ac023004e9212f62cbd
parentefdd17f89510531a6529e20048670bef9a073466 (diff)
parentd1b8b2391c24751e44f618fcf86fb55d9a9247fd (diff)
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull SCSI fixes from James Bottomley: "Two simple fixes, both of which cause I/O hangs. The storvsc one is from the hyper-v which can hang under certain hot add/remove conditions and the other is generally, where removing a target and a device in close proximity can result in the release method being executed twice (and subsequent list and other corruption and an eventual panic)" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: storvsc: Fix scsi_cmd error assignments in storvsc_handle_error scsi: core: check for device state in __scsi_remove_target()
-rw-r--r--drivers/scsi/scsi_sysfs.c5
-rw-r--r--drivers/scsi/storvsc_drv.c3
2 files changed, 6 insertions, 2 deletions
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
index a9996c16f4ae..26ce17178401 100644
--- a/drivers/scsi/scsi_sysfs.c
+++ b/drivers/scsi/scsi_sysfs.c
@@ -1415,7 +1415,10 @@ static void __scsi_remove_target(struct scsi_target *starget)
1415 * check. 1415 * check.
1416 */ 1416 */
1417 if (sdev->channel != starget->channel || 1417 if (sdev->channel != starget->channel ||
1418 sdev->id != starget->id || 1418 sdev->id != starget->id)
1419 continue;
1420 if (sdev->sdev_state == SDEV_DEL ||
1421 sdev->sdev_state == SDEV_CANCEL ||
1419 !get_device(&sdev->sdev_gendev)) 1422 !get_device(&sdev->sdev_gendev))
1420 continue; 1423 continue;
1421 spin_unlock_irqrestore(shost->host_lock, flags); 1424 spin_unlock_irqrestore(shost->host_lock, flags);
diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index 1b06cf0375dc..3b3d1d050cac 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -953,10 +953,11 @@ static void storvsc_handle_error(struct vmscsi_request *vm_srb,
953 case TEST_UNIT_READY: 953 case TEST_UNIT_READY:
954 break; 954 break;
955 default: 955 default:
956 set_host_byte(scmnd, DID_TARGET_FAILURE); 956 set_host_byte(scmnd, DID_ERROR);
957 } 957 }
958 break; 958 break;
959 case SRB_STATUS_INVALID_LUN: 959 case SRB_STATUS_INVALID_LUN:
960 set_host_byte(scmnd, DID_NO_CONNECT);
960 do_work = true; 961 do_work = true;
961 process_err_fn = storvsc_remove_lun; 962 process_err_fn = storvsc_remove_lun;
962 break; 963 break;