diff options
Diffstat (limited to 'sys/kern/vfs_aio.c')
| -rw-r--r-- | sys/kern/vfs_aio.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c index b746f470cbaf..6642fdef0298 100644 --- a/sys/kern/vfs_aio.c +++ b/sys/kern/vfs_aio.c @@ -1330,8 +1330,9 @@ _aio_aqueue(struct thread *td, struct aiocb *job, struct aio_liojob *lj, int typ } fp = aiocbe->fd_file = fdp->fd_ofiles[fd]; - if ((fp == NULL) || ((opcode == LIO_WRITE) && ((fp->f_flag & FWRITE) == - 0))) { + if ((fp == NULL) || + ((opcode == LIO_WRITE) && ((fp->f_flag & FWRITE) == 0)) || + ((opcode == LIO_READ) && ((fp->f_flag & FREAD) == 0))) { FILEDESC_UNLOCK(fdp); uma_zfree(aiocb_zone, aiocbe); if (type == 0) |
