diff options
author | phk <phk@FreeBSD.org> | 2003-08-02 09:45:10 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2003-08-02 09:45:10 +0000 |
commit | adb4818b648cfccea6a070d3a280297d953cfc73 (patch) | |
tree | b733924e36bf4add3f730217a7ab9c373413afd7 /sys/kern/vfs_bio.c | |
parent | 545a2236aefe60062736c1131614210dba7f44b5 (diff) | |
download | FreeBSD-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/kern/vfs_bio.c')
-rw-r--r-- | sys/kern/vfs_bio.c | 4 |
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); } /* |