summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2003-08-02 09:45:10 +0000
committerphk <phk@FreeBSD.org>2003-08-02 09:45:10 +0000
commitadb4818b648cfccea6a070d3a280297d953cfc73 (patch)
treeb733924e36bf4add3f730217a7ab9c373413afd7 /sys
parent545a2236aefe60062736c1131614210dba7f44b5 (diff)
downloadFreeBSD-src-adb4818b648cfccea6a070d3a280297d953cfc73.zip
FreeBSD-src-adb4818b648cfccea6a070d3a280297d953cfc73.tar.gz
Grab Giant in bufdonebio() since drivers may not hold it.
This only protects the "struct buf" consumers (ie: DEV_STRATEGY()), but does not protect BIO_STRATEGY() users.
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/vfs_bio.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c
index 688f4c0..e85a2d3 100644
--- a/sys/kern/vfs_bio.c
+++ b/sys/kern/vfs_bio.c
@@ -3029,7 +3029,11 @@ bufwait(register struct buf * bp)
void
bufdonebio(struct bio *bp)
{
+
+ /* Device drivers may or may not hold giant, hold it here. */
+ mtx_lock(&Giant);
bufdone(bp->bio_caller2);
+ mtx_unlock(&Giant);
}
/*
OpenPOWER on IntegriCloud