From 06363906bcb007b3a86a6b66979476a8afc55675 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Fri, 4 Apr 2003 06:26:28 +0000 Subject: [PATCH] o Remove useracc() calls from aio_qphysio(); they are redundant given the checks performed by vmapbuf(). Reviewed by: tegge --- sys/kern/vfs_aio.c | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c index c014162a8c5..5b844fddf17 100644 --- a/sys/kern/vfs_aio.c +++ b/sys/kern/vfs_aio.c @@ -1114,29 +1114,10 @@ aio_qphysio(struct proc *p, struct aiocblist *aiocbe) bp->b_saveaddr = bp->b_data; bp->b_data = (void *)(uintptr_t)cb->aio_buf; bp->b_blkno = btodb(cb->aio_offset); - - if (cb->aio_lio_opcode == LIO_WRITE) { - bp->b_iocmd = BIO_WRITE; - if (!useracc(bp->b_data, bp->b_bufsize, VM_PROT_READ)) { - error = EFAULT; - goto doerror; - } - } else { - bp->b_iocmd = BIO_READ; - if (!useracc(bp->b_data, bp->b_bufsize, VM_PROT_WRITE)) { - error = EFAULT; - goto doerror; - } - } + bp->b_iocmd = cb->aio_lio_opcode == LIO_WRITE ? BIO_WRITE : BIO_READ; /* * Bring buffer into kernel space. - * - * Note that useracc() alone is not a - * sufficient test. vmapbuf() can still fail - * due to a smaller file mapped into a larger - * area of VM, or if userland races against - * vmapbuf() after the useracc() check. */ if (vmapbuf(bp) < 0) { error = EFAULT;