From owner-freebsd-hackers Sat Jan 5 13:17:30 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from elvis.mu.org (elvis.mu.org [216.33.66.196]) by hub.freebsd.org (Postfix) with ESMTP id 9588637B41A; Sat, 5 Jan 2002 13:17:05 -0800 (PST) Received: by elvis.mu.org (Postfix, from userid 1192) id 3BF2F81D01; Sat, 5 Jan 2002 15:17:05 -0600 (CST) Date: Sat, 5 Jan 2002 15:17:05 -0600 From: Alfred Perlstein To: alc@freebsd.org Cc: tegge@freebsd.org, hackers@freebsd.org Subject: oddness in aio_procrundown? Message-ID: <20020105151705.Z82406@elvis.mu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG ok: at about line 498 in vfs_aio.c: aiocbn = TAILQ_NEXT(aiocbe, plist); fp = fdp->fd_ofiles[aiocbe->uaiocb.aio_fildes]; /* * Under some circumstances, the aio_fildes and the file * structure don't match. This would leave aiocbe's in the * TAILQ associated with the socket and cause a panic later. * * Detect and fix. */ if ((fp == NULL) || (fp != aiocbe->fd_file)) fp = aiocbe->fd_file; So, basically if fp is NULL or not fp != aiocbe->fd_file then it's set to aiocbe->fd_file, doesn't that mean it should just be: fp = aiocbe->fd_file; Index: vfs_aio.c =================================================================== RCS file: /home/ncvs/src/sys/kern/vfs_aio.c,v retrieving revision 1.107 diff -u -r1.107 vfs_aio.c --- vfs_aio.c 2 Jan 2002 07:04:38 -0000 1.107 +++ vfs_aio.c 5 Jan 2002 21:21:00 -0000 @@ -496,17 +496,7 @@ for (aiocbe = TAILQ_FIRST(&ki->kaio_sockqueue); aiocbe; aiocbe = aiocbn) { aiocbn = TAILQ_NEXT(aiocbe, plist); - fp = fdp->fd_ofiles[aiocbe->uaiocb.aio_fildes]; - - /* - * Under some circumstances, the aio_fildes and the file - * structure don't match. This would leave aiocbe's in the - * TAILQ associated with the socket and cause a panic later. - * - * Detect and fix. - */ - if ((fp == NULL) || (fp != aiocbe->fd_file)) - fp = aiocbe->fd_file; + fp = aiocbe->fd_file; if (fp) { so = (struct socket *)fp->f_data; TAILQ_REMOVE(&so->so_aiojobq, aiocbe, list); -- -Alfred Perlstein [alfred@freebsd.org] 'Instead of asking why a piece of software is using "1970s technology," start asking why software is ignoring 30 years of accumulated wisdom.' Tax deductable donations for FreeBSD: http://www.freebsdfoundation.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message