summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2006-01-26 08:37:02 +0000
committerdavidxu <davidxu@FreeBSD.org>2006-01-26 08:37:02 +0000
commite2e1fa02bc6553bfdf833a5c840c6dd968c1201f (patch)
tree2e307a71e217e9a6d466e34a324dbe36b8b42e5d
parent6f41342041bdf21132fca3a1b0728ec216b0c123 (diff)
downloadFreeBSD-src-e2e1fa02bc6553bfdf833a5c840c6dd968c1201f.zip
FreeBSD-src-e2e1fa02bc6553bfdf833a5c840c6dd968c1201f.tar.gz
in aio_aqueue, store same return code into job->_aiocb_private.error.
in aio_return, unlock proc lock before suword.
-rw-r--r--sys/kern/vfs_aio.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c
index 37acf94..52fe545 100644
--- a/sys/kern/vfs_aio.c
+++ b/sys/kern/vfs_aio.c
@@ -1339,7 +1339,7 @@ aio_aqueue(struct thread *td, struct aiocb *job, struct aioliojob *lj,
}
if (error) {
uma_zfree(aiocb_zone, aiocbe);
- suword(&job->_aiocb_private.error, EBADF);
+ suword(&job->_aiocb_private.error, error);
return (error);
}
aiocbe->fd_file = fp;
@@ -1544,12 +1544,14 @@ aio_return(struct thread *td, struct aio_return_args *uap)
cb->inputcharge = 0;
}
aio_free_entry(cb);
+ PROC_UNLOCK(p);
suword(&uaiocb->_aiocb_private.error, error);
suword(&uaiocb->_aiocb_private.status, status);
error = 0;
- } else
+ } else {
error = EINVAL;
- PROC_UNLOCK(p);
+ PROC_UNLOCK(p);
+ }
return (error);
}
OpenPOWER on IntegriCloud