diff options
author | scottl <scottl@FreeBSD.org> | 2007-04-09 05:43:02 +0000 |
---|---|---|
committer | scottl <scottl@FreeBSD.org> | 2007-04-09 05:43:02 +0000 |
commit | 5b7094227581bde3e96e8bd92898c82987b9982d (patch) | |
tree | 23e120c633da2df2200d7141523bcc21bbe1e832 | |
parent | 5218e59269bfd7967b2450bff7139983326d156b (diff) | |
download | FreeBSD-src-5b7094227581bde3e96e8bd92898c82987b9982d.zip FreeBSD-src-5b7094227581bde3e96e8bd92898c82987b9982d.tar.gz |
Fix a logic bug that slipped in at the last minute and apparently escaped
testing.
-rw-r--r-- | sys/cam/scsi/scsi_sg.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/cam/scsi/scsi_sg.c b/sys/cam/scsi/scsi_sg.c index 1601139..6eeedad 100644 --- a/sys/cam/scsi/scsi_sg.c +++ b/sys/cam/scsi/scsi_sg.c @@ -71,8 +71,8 @@ typedef enum { } sg_state; typedef enum { + SG_RDWR_FREE, SG_RDWR_INPROG, - SG_RDWR_WAITING, SG_RDWR_DONE } sg_rdwr_state; @@ -388,8 +388,7 @@ sgdone(struct cam_periph *periph, union ccb *done_ccb) rdwr = done_ccb->ccb_h.ccb_rdwr; state = rdwr->state; rdwr->state = SG_RDWR_DONE; - if (state == SG_RDWR_WAITING) - wakeup(rdwr); + wakeup(rdwr); break; } default: @@ -507,6 +506,7 @@ sgioctl(struct cdev *dev, u_long cmd, caddr_t arg, int flag, struct thread *td) * The linuxolator seems to have a hard time with this, * so just return 0 and hope that apps can cope. */ + td->td_retval[0] = 60*hz; error = 0; break; case SG_IO: @@ -809,7 +809,6 @@ search: break; } if ((rdwr == NULL) || (rdwr->state != SG_RDWR_DONE)) { - rdwr->state = SG_RDWR_WAITING; if (tsleep(rdwr, PCATCH, "sgread", 0) == ERESTART) return (EAGAIN); goto search; |