summaryrefslogtreecommitdiffstats
path: root/sys/vm/vnode_pager.c
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1995-10-19 21:35:03 +0000
committerdg <dg@FreeBSD.org>1995-10-19 21:35:03 +0000
commit61860c0e91f59ef9bb1bf9bfcbf0a3819bdac63c (patch)
tree4cf547b39ec700bbf58b0d918d110199c4256fa0 /sys/vm/vnode_pager.c
parent40905945da1c0f8c40e4a365217da39168cc5bcf (diff)
downloadFreeBSD-src-61860c0e91f59ef9bb1bf9bfcbf0a3819bdac63c.zip
FreeBSD-src-61860c0e91f59ef9bb1bf9bfcbf0a3819bdac63c.tar.gz
Fix initialization of "bsize" in vnode_pager_haspage(). It must happen
after the check for the mount point still existing or else the system will panic if someone forcibly unmounted the filesystem.
Diffstat (limited to 'sys/vm/vnode_pager.c')
-rw-r--r--sys/vm/vnode_pager.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/vm/vnode_pager.c b/sys/vm/vnode_pager.c
index 7b5f5f5..d8c2ab1 100644
--- a/sys/vm/vnode_pager.c
+++ b/sys/vm/vnode_pager.c
@@ -38,7 +38,7 @@
* SUCH DAMAGE.
*
* from: @(#)vnode_pager.c 7.5 (Berkeley) 4/20/91
- * $Id: vnode_pager.c,v 1.48 1995/09/11 00:46:19 dyson Exp $
+ * $Id: vnode_pager.c,v 1.49 1995/09/12 14:42:43 dyson Exp $
*/
/*
@@ -188,11 +188,8 @@ vnode_pager_haspage(object, offset, before, after)
{
struct vnode *vp = object->handle;
daddr_t bn;
- int err, run;
daddr_t reqblock;
- int poff;
- int bsize = vp->v_mount->mnt_stat.f_iosize;
- int pagesperblock;
+ int err, run, poff, bsize, pagesperblock;
/*
* If filesystem no longer mounted or offset beyond end of file we do
@@ -201,6 +198,7 @@ vnode_pager_haspage(object, offset, before, after)
if ((vp->v_mount == NULL) || (offset >= object->un_pager.vnp.vnp_size))
return FALSE;
+ bsize = vp->v_mount->mnt_stat.f_iosize;
pagesperblock = bsize / PAGE_SIZE;
reqblock = offset / bsize;
err = VOP_BMAP(vp, reqblock, (struct vnode **) 0, &bn,
OpenPOWER on IntegriCloud