Skip to content

Commit 71ee203

Browse files
committed
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()
2 parents efdd17f + d1b8b23 commit 71ee203

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

drivers/scsi/scsi_sysfs.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1415,7 +1415,10 @@ static void __scsi_remove_target(struct scsi_target *starget)
14151415
* check.
14161416
*/
14171417
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 ||
14191422
!get_device(&sdev->sdev_gendev))
14201423
continue;
14211424
spin_unlock_irqrestore(shost->host_lock, flags);

drivers/scsi/storvsc_drv.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -953,10 +953,11 @@ static void storvsc_handle_error(struct vmscsi_request *vm_srb,
953953
case TEST_UNIT_READY:
954954
break;
955955
default:
956-
set_host_byte(scmnd, DID_TARGET_FAILURE);
956+
set_host_byte(scmnd, DID_ERROR);
957957
}
958958
break;
959959
case SRB_STATUS_INVALID_LUN:
960+
set_host_byte(scmnd, DID_NO_CONNECT);
960961
do_work = true;
961962
process_err_fn = storvsc_remove_lun;
962963
break;

0 commit comments

Comments
 (0)