From owner-freebsd-bugs Wed Sep 15 11: 0:26 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id D1B6A15361 for ; Wed, 15 Sep 1999 11:00:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id LAA07489; Wed, 15 Sep 1999 11:00:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Date: Wed, 15 Sep 1999 11:00:02 -0700 (PDT) Message-Id: <199909151800.LAA07489@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Christopher Sedore Subject: Re: kern/13075: signal is not posted for async I/O on raw devices Reply-To: Christopher Sedore Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR kern/13075; it has been noted by GNATS. From: Christopher Sedore To: "'freebsd-gnats-submit@freebsd.org'" , "'kwchen@lucent.com'" Cc: Subject: Re: kern/13075: signal is not posted for async I/O on raw devices Date: Wed, 15 Sep 1999 13:55:09 -0400 Here's a patch that should fix the problem. Warning: this patch comes from my own version of vfs_aio.c (no differences exist between my code and the code modified below, except that which is expressed below, so no incompatibilities should arise). This may cause problems because line offsets are significantly different, and I had to hand edit the last patch chunk to eliminate a bunch of followon stuff. *************** lio_listio(struct proc *p, struct lio_li *** 1930,1944 **** * to do so from a timeout routine, but *not* from an interrupt routine. */ static void ! process_signal(void *ljarg) { ! struct aio_liojob *lj = ljarg; ! if (lj->lioj_signal.sigev_notify == SIGEV_SIGNAL) { ! if (lj->lioj_queue_count == lj->lioj_queue_finished_count) { ! psignal(lj->lioj_ki->kaio_p, lj->lioj_signal.sigev_signo); ! lj->lioj_flags |= LIOJ_SIGNAL_POSTED; } } } /* --- 2062,2086 ---- * to do so from a timeout routine, but *not* from an interrupt routine. */ static void ! process_signal(void *aioj) { ! struct aiocblist *aiocbe = aioj; ! struct aio_liojob *lj = aiocbe->lio; ! struct aiocb *cb = &aiocbe->uaiocb; ! ! if (lj) { ! if (lj->lioj_signal.sigev_notify == SIGEV_SIGNAL) { ! if (lj->lioj_queue_count == lj->lioj_queue_finished_count) { ! psignal(lj->lioj_ki->kaio_p, lj->lioj_signal.sigev_signo); ! lj->lioj_flags |= LIOJ_SIGNAL_POSTED; ! } } } + + if (cb->aio_sigevent.sigev_notify == SIGEV_SIGNAL) { + psignal(aiocbe->userproc,cb->aio_sigevent.sigev_signo); + } + } /* *************** aio_physwakeup(bp) *** 1986,1992 **** if ((lj->lioj_flags & (LIOJ_SIGNAL|LIOJ_SIGNAL_POSTED)) == LIOJ_SIGNAL) { lj->lioj_flags |= LIOJ_SIGNAL_POSTED; ! timeout(process_signal, lj, 0); } } } --- 2128,2134 ---- if ((lj->lioj_flags & (LIOJ_SIGNAL|LIOJ_SIGNAL_POSTED)) == LIOJ_SIGNAL) { lj->lioj_flags |= LIOJ_SIGNAL_POSTED; ! timeout(process_signal, aiocbe, 0); } } } *************** aio_physwakeup(bp) *** 2004,2010 **** --- 2146,2154 ---- ki->kaio_flags &= ~KAIO_WAKEUP; wakeup(p); } + + } + + if (aiocbe->uaiocb. aio_sigevent.sigev_notify == SIGEV_SIGNAL) { + timeout(process_signal, aiocbe, 0); } } splx(s); } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message