Date: Fri, 6 Oct 2006 11:16:31 +0800 From: David Xu <davidxu@freebsd.org> To: freebsd-current@freebsd.org Subject: Re: Thread stuck in aioprn Message-ID: <200610061116.31469.davidxu@freebsd.org> In-Reply-To: <20061006001418.GA84293@xor.obsecurity.org> References: <20061004203715.GA38692@xor.obsecurity.org> <20061006001418.GA84293@xor.obsecurity.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200610061116.31469.davidxu>