From: Hannes Reinecke Subject: Check if device is removed in scsi_device_online() References: bnc#456747 scsi_device_online() only checks if the device is not offline; however, any device in SDEV_DEL or SDEV_CANCEL also should be taken into account here. Signed-off-by: Hannes Reinecke diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index e96daf6..63b58d2 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h @@ -401,7 +401,8 @@ static inline unsigned int sdev_id(struct scsi_device *sdev) */ static inline int scsi_device_online(struct scsi_device *sdev) { - return sdev->sdev_state != SDEV_OFFLINE; + return (sdev->sdev_state != SDEV_OFFLINE && + sdev->sdev_state != SDEV_DEL); } static inline int scsi_device_blocked(struct scsi_device *sdev) {