Module Name: src
Committed By: bouyer
Date: Sat Jan 23 18:54:53 UTC 2010
Modified Files:
src/sys/dev/ata: wd.c
Log Message:
struct buf::b_iodone is not called at splbio() any more.
Make sure non-MPsafe iodone callbacks raise the SPL as appropriate.
To generate a diff of this commit:
cvs rdiff -u -r1.382 -r1.383 src/sys/dev/ata/wd.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/ata/wd.c
diff -u src/sys/dev/ata/wd.c:1.382 src/sys/dev/ata/wd.c:1.383
--- src/sys/dev/ata/wd.c:1.382 Tue Jan 19 22:28:31 2010
+++ src/sys/dev/ata/wd.c Sat Jan 23 18:54:53 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: wd.c,v 1.382 2010/01/19 22:28:31 pooka Exp $ */
+/* $NetBSD: wd.c,v 1.383 2010/01/23 18:54:53 bouyer Exp $ */
/*
* Copyright (c) 1998, 2001 Manuel Bouyer. All rights reserved.
@@ -54,7 +54,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.382 2010/01/19 22:28:31 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.383 2010/01/23 18:54:53 bouyer Exp $");
#include "opt_ata.h"
@@ -595,6 +595,7 @@
struct buf *obp = bp->b_private;
struct wd_softc *sc =
device_lookup_private(&wd_cd, DISKUNIT(obp->b_dev));
+ int s;
if (__predict_false(bp->b_error != 0)) {
/*
@@ -623,15 +624,19 @@
bp->b_data = (char *)bp->b_data + bp->b_bcount;
bp->b_blkno += (bp->b_bcount / 512);
bp->b_rawblkno += (bp->b_bcount / 512);
+ s = splbio();
wdstart1(sc, bp);
+ splx(s);
return;
done:
obp->b_error = bp->b_error;
obp->b_resid = bp->b_resid;
+ s = splbio();
putiobuf(bp);
biodone(obp);
sc->openings++;
+ splx(s);
/* wddone() will call wdstart() */
}