aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/vfs_aio.c
diff options
context:
space:
mode:
authorDavid Xu <davidxu@FreeBSD.org>2006-02-22 00:05:12 +0000
committerDavid Xu <davidxu@FreeBSD.org>2006-02-22 00:05:12 +0000
commitad8de0f2435d575c10b3849e70dce850e071fc88 (patch)
treefbdab11b02b708b5b8f9c7d346051cefdbad37f3 /sys/kern/vfs_aio.c
parent7097537784a1270229d1de54e32a7bb4982d9a93 (diff)
downloadsrc-ad8de0f2435d575c10b3849e70dce850e071fc88.tar.gz
src-ad8de0f2435d575c10b3849e70dce850e071fc88.zip
If block size is zero, use normal file operations to do I/O,
this eliminates a divided-by-zero fault. Recommended by: phk
Notes
Notes: svn path=/head/; revision=155887
Diffstat (limited to 'sys/kern/vfs_aio.c')
-rw-r--r--sys/kern/vfs_aio.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c
index b2722dca1867..0ec14b83be0d 100644
--- a/sys/kern/vfs_aio.c
+++ b/sys/kern/vfs_aio.c
@@ -1117,6 +1117,9 @@ aio_qphysio(struct proc *p, struct aiocblist *aiocbe)
return (error);
}
+ if (vp->v_bufobj.bo_bsize == 0)
+ return (-1);
+
if (cb->aio_nbytes % vp->v_bufobj.bo_bsize)
return (-1);