Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern aio_enqueue_job: don't bother to check curjob.



details:   https://anonhg.NetBSD.org/src/rev/9ca4390d8f57
branches:  trunk
changeset: 755637:9ca4390d8f57
user:      yamt <yamt%NetBSD.org@localhost>
date:      Sun Jun 13 04:45:50 2010 +0000

description:
aio_enqueue_job: don't bother to check curjob.
- it's an undefined behaviour anyway.
- the check sometimes prevent legal reuse of userland aiocb.
  note that the userland can notice the i/o completion and reuse the aiocb
  before the aio_worker kernel thread clears curjob.

diffstat:

 sys/kern/sys_aio.c |  11 ++---------
 1 files changed, 2 insertions(+), 9 deletions(-)

diffs (32 lines):

diff -r db48ec697928 -r 9ca4390d8f57 sys/kern/sys_aio.c
--- a/sys/kern/sys_aio.c        Sun Jun 13 04:14:56 2010 +0000
+++ b/sys/kern/sys_aio.c        Sun Jun 13 04:45:50 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sys_aio.c,v 1.32 2010/06/13 04:13:31 yamt Exp $        */
+/*     $NetBSD: sys_aio.c,v 1.33 2010/06/13 04:45:50 yamt Exp $        */
 
 /*
  * Copyright (c) 2007 Mindaugas Rasiukevicius <rmind at NetBSD org>
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sys_aio.c,v 1.32 2010/06/13 04:13:31 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_aio.c,v 1.33 2010/06/13 04:45:50 yamt Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -520,13 +520,6 @@
        aio = p->p_aio;
        if (aio) {
                mutex_enter(&aio->aio_mtx);
-               if (aio->curjob) {
-                       a_job = aio->curjob;
-                       if (a_job->aiocb_uptr == aiocb_uptr) {
-                               mutex_exit(&aio->aio_mtx);
-                               return EINVAL;
-                       }
-               }
                TAILQ_FOREACH(a_job, &aio->jobs_queue, list) {
                        if (a_job->aiocb_uptr != aiocb_uptr)
                                continue;



Home | Main Index | Thread Index | Old Index