summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_aio.c
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2003-04-04 06:26:28 +0000
committeralc <alc@FreeBSD.org>2003-04-04 06:26:28 +0000
commit3c03fd9f549f04244e3aa07cce5ee8dba2d488e8 (patch)
tree8ddb816c3c48e5fe8f8f59d89b1be7f0c310efb0 /sys/kern/vfs_aio.c
parentcbd6318ffdb340e5a49bcbcb93e97b292a5924ff (diff)
downloadFreeBSD-src-3c03fd9f549f04244e3aa07cce5ee8dba2d488e8.zip
FreeBSD-src-3c03fd9f549f04244e3aa07cce5ee8dba2d488e8.tar.gz
o Remove useracc() calls from aio_qphysio(); they are redundant
given the checks performed by vmapbuf(). Reviewed by: tegge
Diffstat (limited to 'sys/kern/vfs_aio.c')
-rw-r--r--sys/kern/vfs_aio.c21
1 files changed, 1 insertions, 20 deletions
diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c
index c014162..5b844fd 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;
OpenPOWER on IntegriCloud