public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH 1/5] scsi host / scsi target state model update
@ 2005-06-22 21:03 Alan Stern
  2005-06-22 23:46 ` Mike Anderson
  0 siblings, 1 reply; 4+ messages in thread
From: Alan Stern @ 2005-06-22 21:03 UTC (permalink / raw)
  To: Mike Anderson; +Cc: SCSI development list

Mike:

In your first patch, you don't allow transitions from SHOST_RECOVERY to 
SHOST_CANCEL nor the other way around.  So this section of the patch looks 
suspicious:

@@ -60,12 +136,11 @@ static void scsi_host_cancel(struct Scsi
 {
        struct scsi_device *sdev;
 
-       set_bit(SHOST_CANCEL, &shost->shost_state);
+       scsi_host_set_state(shost, SHOST_CANCEL);
        shost_for_each_device(sdev, shost) {
                scsi_device_cancel(sdev, recovery);
        }
-       wait_event(shost->host_wait, (!test_bit(SHOST_RECOVERY,
-                                               &shost->shost_state)));
+       wait_event(shost->host_wait, (shost->shost_state != SHOST_RECOVERY));
 }


In fact there are lots of places in the patch where scsi_host_set_state 
is called and the return value is not checked.  They may end up causing 
trouble.

Also, is it a good idea to allow write access to the shost_state 
attribute?  For debugging, yes, okay, but in general it doesn't seem like 
a good thing.

Alan Stern


^ permalink raw reply	[flat|nested] 4+ messages in thread
* [PATCH 0/5] scsi host / scsi target state model update
@ 2005-06-16 18:10 Mike Anderson
  2005-06-16 18:12 ` [PATCH 1/5] " Mike Anderson
  0 siblings, 1 reply; 4+ messages in thread
From: Mike Anderson @ 2005-06-16 18:10 UTC (permalink / raw)
  To: linux-scsi

This patch sequence converts the SCSI host state model to a model like
SCSI device is using and adds a state model for SCSI targets. These new
state models are then used to help in the removal of targets and devices
during removal of a SCSI host.

I have done some simple add and delete testing. The target state model
should have more of the targets states covered. The
list_for_each_entry_safe in __scsi_remove_target needs to be cleaned up.

For background context please refer to previous mail.

http://marc.theaimsgroup.com/?t=111878458800003&r=1&w=2

http://marc.theaimsgroup.com/?t=111833447800002&r=1&w=2


-andmike
--
Michael Anderson
andmike@us.ibm.com


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

end of thread, other threads:[~2005-06-23 15:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-22 21:03 [PATCH 1/5] scsi host / scsi target state model update Alan Stern
2005-06-22 23:46 ` Mike Anderson
2005-06-23 15:57   ` Alan Stern
  -- strict thread matches above, loose matches on Subject: below --
2005-06-16 18:10 [PATCH 0/5] " Mike Anderson
2005-06-16 18:12 ` [PATCH 1/5] " Mike Anderson

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