diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2005-05-22 01:12:48 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2005-05-22 01:12:48 +0000 |
commit | bda15a35d3608003a90619359e20438f587b7041 (patch) | |
tree | 0e0341a87738c7af280cb84c894a1e523e150fe4 /sys/scsi/scsi_base.c | |
parent | 6128ec14f88502b682ed95dced926d152e395d21 (diff) |
Check if the scsi_request has been released in the COMPLETE case as
was already done in the SUCCESSFULLY_QUEUED case. Shouldn't happen,
but better safe than sorry if some driver completes it's io
immediately.
Also don't recompute saved flags if the request is retried.
ok marco@
Diffstat (limited to 'sys/scsi/scsi_base.c')
-rw-r--r-- | sys/scsi/scsi_base.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/scsi/scsi_base.c b/sys/scsi/scsi_base.c index a8981675c1a..9aebd2227af 100644 --- a/sys/scsi/scsi_base.c +++ b/sys/scsi/scsi_base.c @@ -1,4 +1,4 @@ -/* $OpenBSD: scsi_base.c,v 1.68 2005/05/14 00:20:43 krw Exp $ */ +/* $OpenBSD: scsi_base.c,v 1.69 2005/05/22 01:12:47 krw Exp $ */ /* $NetBSD: scsi_base.c,v 1.43 1997/04/02 02:29:36 mycroft Exp $ */ /* @@ -577,7 +577,6 @@ scsi_execute_xs(xs) xs->resid = xs->datalen; xs->status = 0; -retry: /* * Do the transfer. If we are polling we will return: * COMPLETE, Was poll, and scsi_done has been called @@ -615,7 +614,7 @@ retry: if ((flags & (SCSI_USER | SCSI_POLL)) == (SCSI_USER | SCSI_POLL)) panic("scsi_execute_xs: USER with POLL"); #endif - +retry: switch ((*(xs->sc_link->adapter->scsi_cmd)) (xs)) { case SUCCESSFULLY_QUEUED: if ((flags & (SCSI_NOSLEEP | SCSI_POLL)) == SCSI_NOSLEEP) @@ -629,6 +628,8 @@ retry: tsleep(xs, PRIBIO + 1, "scsi_scsi_cmd", 0); splx(s); case COMPLETE: /* Polling command completed ok */ + if ((flags & (SCSI_NOSLEEP | SCSI_POLL)) == SCSI_NOSLEEP) + return EJUSTRETURN; if (xs->bp) return EJUSTRETURN; doit: |