From owner-freebsd-fs@FreeBSD.ORG Wed Apr 4 09:30:31 2012 Return-Path: Delivered-To: freebsd-fs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E5E51065675 for ; Wed, 4 Apr 2012 09:30:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id A4A5B8FC18 for ; Wed, 4 Apr 2012 09:30:30 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id MAA23295; Wed, 04 Apr 2012 12:30:28 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1SFMXs-000Mzk-9B; Wed, 04 Apr 2012 12:30:28 +0300 Message-ID: <4F7C14B3.3040705@FreeBSD.org> Date: Wed, 04 Apr 2012 12:30:27 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:10.0.3) Gecko/20120317 Thunderbird/10.0.3 MIME-Version: 1.0 To: Attila Nagy References: <4F7BFDD4.6080703@fsn.hu> <4F7C088D.4070803@FreeBSD.org> <4F7C0B41.20702@fsn.hu> <4F7C0CE4.2030408@FreeBSD.org> <4F7C129B.9010206@fsn.hu> In-Reply-To: <4F7C129B.9010206@fsn.hu> X-Enigmail-Version: 1.4 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-fs@FreeBSD.org Subject: Re: SEEK_HOLE and SEEK_DATA does not work on zfs (with test case) X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Apr 2012 09:30:31 -0000 on 04/04/2012 12:21 Attila Nagy said the following: > On 04/04/12 10:57, Andriy Gapon wrote: >> on 04/04/2012 11:50 Attila Nagy said the following: >>> On 04/04/12 10:38, Andriy Gapon wrote: >>>> on 04/04/2012 10:52 Attila Nagy said the following: >>>>> Hi, >>>>> >>>>> I've started to experiment with SEEK_HOLE and SEEK_DATA in python on a recent >>>>> FreeBSD 9-STABLE/amd64 box and it quickly became evident that the program that >>>>> works on Solaris doesn't work on FreeBSD. >>>>> Python itself couldn't cause this, because it correctly issues the lseek, but >>>>> taking the C test program from here: >>>>> https://lkml.org/lkml/2011/4/22/79 >>>>> gives the same result (failure). >>>> Please see this PR: http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/164445 >>>> If you can't figure out a patch from its contents, then I'll try to provide it >>>> some time later today. >>>> >>> I will try it, but the e-mail above the patch is somewhat scary... >> Sorry, I could not understand what you mean. >> > "The patch does the copy of the offset passed from the application > correctly, and allows lseek(2) with SEEK_DATA/SEEK_HOLE to be used on > ZFS, but it is not a solution. I couldn't see a problem in the > assembler of the copyin and copyout functions in > sys/amd64/amd64/support.S, but I might be wrong, I'm no assembler > expert." > > This is scary. :) Did you see my comment in the PR trail? It explains why that approach is not scary but entirely correct. Due to some mailing issues it is re-ordered with the patch. -- Andriy Gapon