From owner-freebsd-current@FreeBSD.ORG Fri Oct 6 03:16:36 2006 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from localhost.my.domain (localhost [127.0.0.1]) by hub.freebsd.org (Postfix) with ESMTP id 1FD7E16A40F for ; Fri, 6 Oct 2006 03:16:36 +0000 (UTC) (envelope-from davidxu@freebsd.org) From: David Xu To: freebsd-current@freebsd.org Date: Fri, 6 Oct 2006 11:16:31 +0800 User-Agent: KMail/1.8.2 References: <20061004203715.GA38692@xor.obsecurity.org> <20061006001418.GA84293@xor.obsecurity.org> In-Reply-To: <20061006001418.GA84293@xor.obsecurity.org> MIME-Version: 1.0 Message-Id: <200610061116.31469.davidxu@freebsd.org> Content-Type: Multipart/Mixed; boundary="Boundary-00=_PqcJFw98v0x3/yc" Subject: Re: Thread stuck in aioprn X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Oct 2006 03:16:36 -0000 --Boundary-00=_PqcJFw98v0x3/yc Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: 7bit Content-Disposition: inline On Friday 06 October 2006 08:14, Kris Kennaway wrote: > FYI, this has recurred, so it seems to be an easy problem to trigger. > > Kris can you try attached patch ? it disables support for non-disk files, I suspect the test passed non-disk file handle to aio, and caused the problem. David Xu --Boundary-00=_PqcJFw98v0x3/yc Content-Type: text/x-diff; charset="gb2312"; name="vfs_aio.c.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="vfs_aio.c.diff" Index: vfs_aio.c =================================================================== RCS file: /home/ncvs/src/sys/kern/vfs_aio.c,v retrieving revision 1.227 diff -u -r1.227 vfs_aio.c --- vfs_aio.c 24 Sep 2006 04:47:47 -0000 1.227 +++ vfs_aio.c 6 Oct 2006 03:13:40 -0000 @@ -1331,6 +1331,7 @@ struct socket *so; struct aiocblist *aiocbe, *cb; struct kaioinfo *ki; + struct vnode *vp; struct kevent kev; struct sockbuf *sb; int opcode; @@ -1410,6 +1411,18 @@ default: error = fget(td, fd, &fp); } + + if (error == 0) { + /* XXX Only block device and disk file is supported */ + if (fp->f_type != DTYPE_VNODE) + error = ENOTSUP; + else { + vp = fp->f_vnode; + if (vp->v_type != VREG && !vn_isdisk(vp, &error)) + error = ENOTSUP; + } + } + if (error) { uma_zfree(aiocb_zone, aiocbe); suword(&job->_aiocb_private.error, error); --Boundary-00=_PqcJFw98v0x3/yc--