Don't online offlined devices in scsi_target_quiesce()
PATCH 1/5 Don't online offlined devices in scsi_target_quiesce()
Don't online offlined devices in scsi_target_quiesce(), it often onlines devices which just have been take offline due to an error on the host.
Signed-off-by Bernd Schubert <[email protected]>
--- drivers/scsi/scsi_lib.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/scsi/scsi_lib.c +9 -1
@@ -2487,7 +2487,15 @@ device_quiesce_fn(struct scsi_device *sdvoid scsi_target_quiesce (struct scsi_target *starget) { -starget_for_each_device (starget,NULL , device_quiesce_fn); +struct Scsi_Host *shost =dev_to_shost (starget->dev.parent); +struct scsi_device *sdev; + +shost_for_each_device (sdev, shost) { +if ((sdev->channel == starget->channel) && + (sdev->id == starget->id) && + (sdev->sdev_state !=SDEV_OFFLINE )) +device_quiesce_fn (sdev,NULL ); + } }EXPORT_SYMBOL (scsi_target_quiesce);