diff options
author | davidxu <davidxu@FreeBSD.org> | 2006-01-22 09:25:52 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2006-01-22 09:25:52 +0000 |
commit | 362cb85fb625a628be1b60b0cba25cfe834b0c4c (patch) | |
tree | 6fe7a5b5ba9b5418e93456edc2d56d019023b91a /sys/kern/vfs_aio.c | |
parent | ea6572d21957f573976c21432c412ee7fdd9a4e2 (diff) | |
download | FreeBSD-src-362cb85fb625a628be1b60b0cba25cfe834b0c4c.zip FreeBSD-src-362cb85fb625a628be1b60b0cba25cfe834b0c4c.tar.gz |
Decrease kaio_active_count first, because user process may go away
after we notified it.
Diffstat (limited to 'sys/kern/vfs_aio.c')
-rw-r--r-- | sys/kern/vfs_aio.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c index b1b3288..b334def 100644 --- a/sys/kern/vfs_aio.c +++ b/sys/kern/vfs_aio.c @@ -944,6 +944,11 @@ aio_daemon(void *_id) /* Do the I/O function. */ aio_process(aiocbe); + mtx_lock(&aio_job_mtx); + /* Decrement the active job count. */ + ki->kaio_active_count--; + mtx_unlock(&aio_job_mtx); + PROC_LOCK(userp); TAILQ_REMOVE(&ki->kaio_jobqueue, aiocbe, plist); aio_bio_done_notify(userp, aiocbe, DONE_QUEUE); @@ -954,8 +959,6 @@ aio_daemon(void *_id) PROC_UNLOCK(userp); mtx_lock(&aio_job_mtx); - /* Decrement the active job count. */ - ki->kaio_active_count--; } /* |