Skip to content

Commit

Permalink
[SCSI] Check for deleted device in scsi_device_online()
Browse files Browse the repository at this point in the history
scsi_device_online() is not just a negation of SDEV_OFFLINE,
also devices in state SDEV_DEL are actually offline.

Signed-off-by: Hannes Reinecke <[email protected]>
Signed-off-by: James Bottomley <[email protected]>
  • Loading branch information
hreinecke authored and James Bottomley committed Mar 12, 2009
1 parent 71fa742 commit 0762a48
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/scsi/scsi_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit 0762a48

Please sign in to comment.