diff options
author | jasone <jasone@FreeBSD.org> | 2000-01-20 01:59:58 +0000 |
---|---|---|
committer | jasone <jasone@FreeBSD.org> | 2000-01-20 01:59:58 +0000 |
commit | ff778f6b274deda4ef8dbba14a9f4180cee616c2 (patch) | |
tree | 18f262df1a3f3b9f2964f2c6b0b9a0d668190b38 /sys/kern/vfs_aio.c | |
parent | ba86f900bffcd74a54e07d93c67b59f2087d72ac (diff) | |
download | FreeBSD-src-ff778f6b274deda4ef8dbba14a9f4180cee616c2.zip FreeBSD-src-ff778f6b274deda4ef8dbba14a9f4180cee616c2.tar.gz |
Don't tsleep() while at splbio().
Correctly return EINPROGRESS from aio_error() even when an aio request
is still in the socket queue.
Submitted by: Adrian Chadd <adrian@bofh.co.uk>
Diffstat (limited to 'sys/kern/vfs_aio.c')
-rw-r--r-- | sys/kern/vfs_aio.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c index fa953cd..175b50f 100644 --- a/sys/kern/vfs_aio.c +++ b/sys/kern/vfs_aio.c @@ -1543,12 +1543,12 @@ aio_suspend(struct proc *p, struct aio_suspend_args *uap) } } } + splx(s); ki->kaio_flags |= KAIO_WAKEUP; error = tsleep(p, PRIBIO | PCATCH, "aiospn", timo); - splx(s); - if (error == EINTR) { + if (error == ERESTART || error == EINTR) { zfree(aiol_zone, ijoblist); zfree(aiol_zone, ujoblist); return EINTR; @@ -1614,6 +1614,16 @@ aio_error(struct proc *p, struct aio_error_args *uap) return 0; } } + + for (cb = TAILQ_FIRST(&ki->kaio_sockqueue); cb; cb = TAILQ_NEXT(cb, + plist)) { + if (((intptr_t)cb->uaiocb._aiocb_private.kernelinfo) == + jobref) { + p->p_retval[0] = EINPROGRESS; + splx(s); + return 0; + } + } splx(s); s = splbio(); |