summaryrefslogtreecommitdiff
path: root/sys/scsi/cd.c
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2010-01-09 21:12:07 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2010-01-09 21:12:07 +0000
commitf530cae7088891a665f204338f63af142add258d (patch)
treefeb8d0b54b8095978b84e1bab3d58158530fdcaf /sys/scsi/cd.c
parent0acd547b2e00191799edec5d0d889e5a8cd99aa1 (diff)
dont try to prevent multiple concurrent runs of a devices start routine
by setting flags around the loop. there is a race which can prevent necessary work being completed by any of the currently running instances of xxstart. the caveat with the removal of this code is because multiple xxstarts can be running at the same time they can cause io reordering, but that is less of a problem than no io. found by and fix tested by claudio@ debugged with krw@ claudio@ beck@ deraadt@
Diffstat (limited to 'sys/scsi/cd.c')
-rw-r--r--sys/scsi/cd.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/sys/scsi/cd.c b/sys/scsi/cd.c
index 5b993c3077c..49ab9d6f73b 100644
--- a/sys/scsi/cd.c
+++ b/sys/scsi/cd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cd.c,v 1.157 2009/12/16 10:51:28 dlg Exp $ */
+/* $OpenBSD: cd.c,v 1.158 2010/01/09 21:12:06 dlg Exp $ */
/* $NetBSD: cd.c,v 1.100 1997/04/02 02:29:30 mycroft Exp $ */
/*
@@ -104,7 +104,6 @@ struct cd_softc {
#define CDF_LABELLING 0x08 /* writing label */
#define CDF_ANCIENT 0x10 /* disk is ancient; for minphys */
#define CDF_WAITING 0x100
-#define CDF_STARTING 0x200
struct scsi_link *sc_link; /* contains our targ, lun, etc. */
struct cd_parms {
u_int32_t blksize;
@@ -611,15 +610,6 @@ cdstart(void *v)
* Check if the device has room for another command
*/
- mtx_enter(&sc->sc_start_mtx);
- if (ISSET(sc->sc_flags, CDF_STARTING)) {
- mtx_leave(&sc->sc_start_mtx);
- return;
- }
-
- SET(sc->sc_flags, CDF_STARTING);
- mtx_leave(&sc->sc_start_mtx);
-
CLR(sc->sc_flags, CDF_WAITING);
while (!ISSET(sc->sc_flags, CDF_WAITING) &&
(bp = cd_buf_dequeue(sc)) != NULL) {
@@ -700,9 +690,6 @@ cdstart(void *v)
scsi_xs_exec(xs);
}
- mtx_enter(&sc->sc_start_mtx);
- CLR(sc->sc_flags, CDF_STARTING);
- mtx_leave(&sc->sc_start_mtx);
}
void