summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_bio.c
diff options
context:
space:
mode:
authormiod <miod@openbsd.org>2007-07-09 15:30:25 +0000
committermiod <miod@openbsd.org>2007-07-09 15:30:25 +0000
commit28a97694fc518aabf2856ae29be361a6d4a4d43d (patch)
tree7183e1c5ae68cffb29cddc2ef22bb50230d6e118 /sys/kern/vfs_bio.c
parenttweaks; (diff)
downloadwireguard-openbsd-28a97694fc518aabf2856ae29be361a6d4a4d43d.tar.xz
wireguard-openbsd-28a97694fc518aabf2856ae29be361a6d4a4d43d.zip
Do not allow clustering read for filesystems which block size is smaller
than the hardware page size, as was the case in the old clustering code. This fixes vnd reads on alpha and sparc64 On behalf of pedro@, ok art@
Diffstat (limited to 'sys/kern/vfs_bio.c')
-rw-r--r--sys/kern/vfs_bio.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c
index c8e3a2a047a..12896be67a2 100644
--- a/sys/kern/vfs_bio.c
+++ b/sys/kern/vfs_bio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_bio.c,v 1.97 2007/06/17 20:06:10 jasper Exp $ */
+/* $OpenBSD: vfs_bio.c,v 1.98 2007/07/09 15:30:25 miod Exp $ */
/* $NetBSD: vfs_bio.c,v 1.44 1996/06/11 11:15:36 pk Exp $ */
/*-
@@ -462,16 +462,17 @@ bread_cluster(struct vnode *vp, daddr64_t blkno, int size, struct buf **rbpp)
*rbpp = bio_doread(vp, blkno, size, 0);
- size = round_page(size);
- howmany = MAXPHYS / size;
+ if (size != round_page(size))
+ return (biowait(*rbpp));
if (VOP_BMAP(vp, blkno + 1, NULL, &sblkno, &maxra))
return (biowait(*rbpp));
- maxra++;
+ maxra++;
if (sblkno == -1 || maxra < 2)
return (biowait(*rbpp));
+ howmany = MAXPHYS / size;
if (howmany > maxra)
howmany = maxra;