diff options
author | James Bottomley <James.Bottomley@steeleye.com> | 2005-09-18 16:05:20 -0400 |
---|---|---|
committer | James Bottomley <jejb@titanic.(none)> | 2005-09-19 10:24:52 -0400 |
commit | 939647ee308e0ad924e776657704c7bedd498664 (patch) | |
tree | cfff68b8f65a53e186fd1e7443aa370885ac1ed9 /include | |
parent | a64358db1253b35d508a411e80a3ad23b859ec88 (diff) |
[SCSI] fix oops on usb storage device disconnect
We fix the oops by enforcing the host state model. There have also
been two extra states added: SHOST_CANCEL_RECOVERY and
SHOST_DEL_RECOVERY so we can take the model through host removal while
the recovery thread is active.
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/scsi/scsi_host.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index 916144be208b..540369ff815c 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h | |||
@@ -439,6 +439,8 @@ enum scsi_host_state { | |||
439 | SHOST_CANCEL, | 439 | SHOST_CANCEL, |
440 | SHOST_DEL, | 440 | SHOST_DEL, |
441 | SHOST_RECOVERY, | 441 | SHOST_RECOVERY, |
442 | SHOST_CANCEL_RECOVERY, | ||
443 | SHOST_DEL_RECOVERY, | ||
442 | }; | 444 | }; |
443 | 445 | ||
444 | struct Scsi_Host { | 446 | struct Scsi_Host { |
@@ -621,6 +623,13 @@ static inline struct Scsi_Host *dev_to_shost(struct device *dev) | |||
621 | return container_of(dev, struct Scsi_Host, shost_gendev); | 623 | return container_of(dev, struct Scsi_Host, shost_gendev); |
622 | } | 624 | } |
623 | 625 | ||
626 | static inline int scsi_host_in_recovery(struct Scsi_Host *shost) | ||
627 | { | ||
628 | return shost->shost_state == SHOST_RECOVERY || | ||
629 | shost->shost_state == SHOST_CANCEL_RECOVERY || | ||
630 | shost->shost_state == SHOST_DEL_RECOVERY; | ||
631 | } | ||
632 | |||
624 | extern int scsi_queue_work(struct Scsi_Host *, struct work_struct *); | 633 | extern int scsi_queue_work(struct Scsi_Host *, struct work_struct *); |
625 | extern void scsi_flush_work(struct Scsi_Host *); | 634 | extern void scsi_flush_work(struct Scsi_Host *); |
626 | 635 | ||