aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>2003-08-02 09:40:53 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>2003-08-02 09:40:53 +0000
commitf7e56e489d533513f2693b377a718ec26dac2861 (patch)
tree4df55c3ceec1f36d298d6483bfef57bc2ac9ab5c /sys
parente4bbcfbc420f484d1b46066db22547821c8cd88a (diff)
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/kern_physio.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/kern/kern_physio.c b/sys/kern/kern_physio.c
index ee89dd16c8535..20789d57f776e 100644
--- a/sys/kern/kern_physio.c
+++ b/sys/kern/kern_physio.c
@@ -41,6 +41,8 @@ physio(dev_t dev, struct uio *uio, int ioflag)
u_int iolen;
struct buf *bp;
+ /* We cannot trust the device driver to hold Giant for us */
+ mtx_lock(&Giant);
/* Keep the process UPAGES from being swapped. XXX: why ? */
PHOLD(curproc);
@@ -122,5 +124,6 @@ physio(dev_t dev, struct uio *uio, int ioflag)
doerror:
relpbuf(bp, NULL);
PRELE(curproc);
+ mtx_unlock(&Giant);
return (error);
}