diff options
author | alc <alc@FreeBSD.org> | 2000-10-29 21:38:28 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2000-10-29 21:38:28 +0000 |
commit | 452893ff8d0bdddd07b3763a308d2437c88adaca (patch) | |
tree | 9500b7c8c74a15cffb2a7b4f3b747aa94d47663c /sys | |
parent | 03e9a76a97c365de856315bf361e500bfbcb9475 (diff) | |
download | FreeBSD-src-452893ff8d0bdddd07b3763a308d2437c88adaca.zip FreeBSD-src-452893ff8d0bdddd07b3763a308d2437c88adaca.tar.gz |
_aio_aqueue(): Change kevent registration to use its own struct file pointer.
Otherwise, aio_read() and aio_write() on sockets are broken if a kevent is
registered. (The code after kevent registration for handling sockets assumes
that the struct file pointer "fp" still refers to the socket, not the kqueue.)
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/vfs_aio.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c index 91b2977..a564886 100644 --- a/sys/kern/vfs_aio.c +++ b/sys/kern/vfs_aio.c @@ -1300,6 +1300,7 @@ _aio_aqueue(struct proc *p, struct aiocb *job, struct aio_liojob *lj, int type) { struct kevent kev, *kevp; struct kqueue *kq; + struct file *kq_fp; kevp = (struct kevent *)job->aio_lio_opcode; if (kevp == NULL) @@ -1310,12 +1311,12 @@ _aio_aqueue(struct proc *p, struct aiocb *job, struct aio_liojob *lj, int type) goto aqueue_fail; if ((u_int)kev.ident >= fdp->fd_nfiles || - (fp = fdp->fd_ofiles[kev.ident]) == NULL || - (fp->f_type != DTYPE_KQUEUE)) { + (kq_fp = fdp->fd_ofiles[kev.ident]) == NULL || + (kq_fp->f_type != DTYPE_KQUEUE)) { error = EBADF; goto aqueue_fail; } - kq = (struct kqueue *)fp->f_data; + kq = (struct kqueue *)kq_fp->f_data; kev.ident = (u_long)aiocbe; kev.filter = EVFILT_AIO; kev.flags = EV_ADD | EV_ENABLE | EV_FLAG1; |