Date: Wed, 9 May 2007 10:37:34 -0500 From: "Scot Hetzel" <swhetzel@gmail.com> To: "Bruce Evans" <bde@zeta.org.au> Cc: emulation@freebsd.org, Pawel Jakub Dawidek <pjd@freebsd.org> Subject: Re: linuxolator: LTP lseek03 failure Message-ID: <790a9fff0705090837x3fe2ae7t15d5ceec21a39f40@mail.gmail.com> In-Reply-To: <20070509223211.O6076@delplex.bde.org> References: <790a9fff0705021345j2ad9ae98o56aaf357d556fe27@mail.gmail.com> <790a9fff0705040004oab16ed8q1a1c476386379ea9@mail.gmail.com> <20070504190007.Y37951@besplex.bde.org> <790a9fff0705040819u24e4c2f0s5c9fc34b93770e13@mail.gmail.com> <790a9fff0705061005v1a1a883ehc155bac7f747c3eb@mail.gmail.com> <20070507124848.S47783@besplex.bde.org> <790a9fff0705080724o1039c405g1cfa1b31ba6a91be@mail.gmail.com> <20070509223211.O6076@delplex.bde.org>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] On 5/9/07, Bruce Evans <bde@zeta.org.au> wrote: > On Tue, 8 May 2007, Scot Hetzel wrote: > > On 5/6/07, Bruce Evans <bde@zeta.org.au> wrote: > > I then created a patch to kern/vfs_vnops.c:vn_ioctl that checked if > > com was either SEEK_DATA or SEEK_HOLE and return EINVAL. While this > > worked for UFS, it disabled SEEK_[DATA,HOLE] for ZFS. > > I meant to just translate ENOTTY to EINVAL after calling VOP_IOCTL(). > The vop must be called to see what it wants to do. > The attached patch to kern/vfs_vnops.c translates ENOTTY to EINVAL after calling VOP_IOCTL for the SEEK_[DATA,HOLE] cases only. With this patch applied, the lseek03 test now returns with ENXIO on zfs filesystems, and EINVAL on non-zfs filesystems. Should all ENOTTY cases be changed to EINVAL, or just the SEEK_[DATA,HOLE] cases. Scot -- DISCLAIMER: No electrons were mamed while sending this message. Only slightly bruised. [-- Attachment #2 --] Index: vfs_vnops.c =================================================================== RCS file: /home/ncvs/src/sys/kern/vfs_vnops.c,v retrieving revision 1.248 diff -u -r1.248 vfs_vnops.c --- vfs_vnops.c 12 Feb 2007 22:53:01 -0000 1.248 +++ vfs_vnops.c 9 May 2007 13:12:05 -0000 @@ -755,6 +755,9 @@ else error = VOP_IOCTL(vp, com, data, fp->f_flag, active_cred, td); + if (error == ENOTTY && + (com = FIOSEEKDATA || com == FIOSEEKHOLE)) + error = EINVAL; break; default:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?790a9fff0705090837x3fe2ae7t15d5ceec21a39f40>
