diff options
author | David Xu <davidxu@FreeBSD.org> | 2006-02-22 00:05:12 +0000 |
---|---|---|
committer | David Xu <davidxu@FreeBSD.org> | 2006-02-22 00:05:12 +0000 |
commit | ad8de0f2435d575c10b3849e70dce850e071fc88 (patch) | |
tree | fbdab11b02b708b5b8f9c7d346051cefdbad37f3 /sys/kern/vfs_aio.c | |
parent | 7097537784a1270229d1de54e32a7bb4982d9a93 (diff) | |
download | src-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.c | 3 |
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); |