1 Jun 2010 03:09
possible fix to races in ami(4)
David Gwynne <loki <at> animata.net>
2010-06-01 01:09:53 GMT
2010-06-01 01:09:53 GMT
you cant test a variable and then sleep on it without blocking
interrupts, cos a completion could change the variables state between
those two actions.
could anyone test setting a hotspare on ami(4) while doing io?
dlg
Index: ami.c
===================================================================
RCS file: /cvs/src/sys/dev/ic/ami.c,v
retrieving revision 1.204
diff -u -p ami.c
--- ami.c 20 May 2010 00:55:17 -0000 1.204
+++ ami.c 31 May 2010 12:42:47 -0000
<at> <at> -186,11 +186,8 <at> <at> ami_remove_runq(struct ami_ccb *ccb)
splassert(IPL_BIO);
TAILQ_REMOVE(&ccb->ccb_sc->sc_ccb_runq, ccb, ccb_link);
- if (TAILQ_EMPTY(&ccb->ccb_sc->sc_ccb_runq)) {
- ccb->ccb_sc->sc_drained = 1;
- if (ccb->ccb_sc->sc_drainio)
- wakeup(ccb->ccb_sc);
- }
+ if (ccb->ccb_sc->sc_drainio && TAILQ_EMPTY(&ccb->ccb_sc->sc_ccb_runq))
+ wakeup(ccb->ccb_sc);
}
void
<at> <at> -198,7 +195,6 <at> <at> ami_insert_runq(struct ami_ccb *ccb)
(Continue reading)
RSS Feed