Module Name:    src
Committed By:   yamt
Date:           Sun Jun 13 04:45:51 UTC 2010

Modified Files:
        src/sys/kern: sys_aio.c

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/kern/sys_aio.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/sys_aio.c
diff -u src/sys/kern/sys_aio.c:1.32 src/sys/kern/sys_aio.c:1.33
--- src/sys/kern/sys_aio.c:1.32	Sun Jun 13 04:13:31 2010
+++ src/sys/kern/sys_aio.c	Sun Jun 13 04:45:50 2010
@@ -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;

Reply via email to