public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Check for deleted device in scsi_device_online()
@ 2008-12-16 15:33 Hannes Reinecke
  2009-01-08 16:27 ` James Bottomley
  0 siblings, 1 reply; 3+ messages in thread
From: Hannes Reinecke @ 2008-12-16 15:33 UTC (permalink / raw)
  To: James Bottomley; +Cc: linux-scsi


scsi_device_online() is not just a negation of SDEV_OFFLINE,
also devices in state SDEV_CANCEL and SDEV_DEL are
actually offline.

Signed-off-by: Hannes Reinecke <hare@suse.de>
---
 include/scsi/scsi_device.h |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

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,9 @@ 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_CANCEL &&
+		sdev->sdev_state != SDEV_DEL);
 }
 static inline int scsi_device_blocked(struct scsi_device *sdev)
 {
-- 
1.5.3.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-01-12  8:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-16 15:33 [PATCH] Check for deleted device in scsi_device_online() Hannes Reinecke
2009-01-08 16:27 ` James Bottomley
2009-01-12  8:28   ` Hannes Reinecke

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox