xfs
[Top] [All Lists]

Re: [PATCH 2/4 v3] fiemap: add EXTENT_DATA_COMPRESSED flag

To: Andreas Dilger <adilger@xxxxxxxxx>
Subject: Re: [PATCH 2/4 v3] fiemap: add EXTENT_DATA_COMPRESSED flag
From: Rohan Puri <rohan.puri15@xxxxxxxxx>
Date: Fri, 25 Jul 2014 11:50:58 +0530
Cc: dsterba@xxxxxxx, linux-fsdevel <linux-fsdevel@xxxxxxxxxxxxxxx>, linux-nilfs@xxxxxxxxxxxxxxx, xfs@xxxxxxxxxxx, Btrfs Developer List <linux-btrfs@xxxxxxxxxxxxxxx>, Ext4 Developers List <linux-ext4@xxxxxxxxxxxxxxx>, ocfs2-devel@xxxxxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Cue1c+bFUaagfhxb5xBdnMeL/PdvCPsyykz+dvqYw98=; b=ZCqogQR1vpu8LM4Db65rIrs3Y2iyRrbsqwV8xKQd/DOZfnxOFNl3cRnVgSUXAmHELY j1RestdYZG5Hy9NuxyFaF1YzWEzAhFnStAkt39PaJPV7RQziyyOUnpbYMNnK4hLvpzOK RZF2tCJxvr3UAIT+cVe/NqJ45CgTaJ0YdkuumvFFKet9GLEZtitckWJ30PzRHT6KivR+ Q9DHQoHwFg7uX00VXOXgF0t3BFW1FPHgvf6C3Wij/INlTty10WiER5Q1KKSsxg5W4xpj AFyo6RL9s4s3GSuYIqqruc+69+/OZNzx3zW4nXQsd3iqaYIxxxCrZob/9LAOiPXwbiBA yCGg==
In-reply-to: <5B4825C3-F47E-48B7-8DA4-6D79F53B73B1@xxxxxxxxx>
References: <cover.1386778302.git.dsterba@xxxxxxx> <4f8d5dc5b51a43efaf16c39398c23a6276e40a30.1386778303.git.dsterba@xxxxxxx> <20131212232443.GL31386@dastard> <9520AB36-B728-423A-8EA1-FDD22B79AE90@xxxxxxxxx> <B58DEEA8-561A-4173-B9F5-528B73E06C6D@xxxxxxxxx> <20140724192245.GG1553@xxxxxxx> <5B4825C3-F47E-48B7-8DA4-6D79F53B73B1@xxxxxxxxx>
On Fri, Jul 25, 2014 at 4:04 AM, Andreas Dilger <adilger@xxxxxxxxx> wrote:
>
> On Jul 24, 2014, at 1:22 PM, David Sterba <dsterba@xxxxxxx> wrote:
>> On Thu, Jul 17, 2014 at 12:07:57AM -0600, Andreas Dilger wrote:
>>> any progress on this patch series?
>>
>> I'm sorry I got distracted at the end of year and did not finish the
>> series.
>>
>>> I never saw an updated version of this patch series after the last round of
>>> reviews, but it would be great to move it forward.  I have filefrag patches
>>> in my e2fsprogs tree waiting for an updated version of your patch.
>>>
>>> I recall the main changes were:
>>> - add FIEMAP_EXTENT_PHYS_LENGTH flag to indicate if fe_phys_length was valid
>>
>> fe_phys_length will be always valid, so other the flags are set only if it's
>> not equal to the logical length.
>>
>>> - rename fe_length to fe_logi_length and #define fe_length fe_logi_length
>>> - always fill in fe_phys_length (= fe_logi_length for uncompressed files)
>>>  and set FIEMAP_EXTENT_PHYS_LENGTH whether the extent is compressed or not
>>
>> This is my understanding and contradicts the first point.
>
> I think Dave Chinner's former point was that having fe_phys_length validity
> depend on FIEMAP_EXTENT_DATA_COMPRESSED is a non-intuitive interface.  It is
> not true that fe_phys_length would always be valid, since that is not the
> case for older kernels that currently always set this field to 0, so they
> need some flag to indicate if fe_phys_length is valid.  Alternately,
> userspace could do:
>
>         if (ext->fe_phys_length == 0)
>                 ext->fe_phys_length = ext->fe_logi_length;
>
> but that pre-supposes that fe_phys_length == 0 is never a valid value when
> fe_logi_length is non-zero, and this might introduce errors in some cases.
> I could imagine that some compression methods might not allocate any space
> at all if it was all zeroes, and just store a bit in the blockpointer or
> extent, so having a separate FIEMAP_EXTENT_PHYS_LENGTH is probably safer
> in the long run.
zfs is an example of this.
> That opens up the question of whether a written zero
> filled space that gets compressed away is different from a hole, but I'd
> prefer to just return whatever the file mapping is than interpret it.
>
> Cheers, Andreas
>
>>> - add WARN_ONCE() in fiemap_fill_next_extent() as described below
>>>
>>> I don't know if there was any clear statement about whether there should be
>>> separate FIEMAP_EXTENT_PHYS_LENGTH and FIEMAP_EXTENT_DATA_COMPRESSED flags,
>>> or if the latter should be implicit?  Probably makes sense to have separate
>>> flags.  It should be fine to use:
>>>
>>> #define FIEMAP_EXTENT_PHYS_LENGTH    0x00000010
>>>
>>> since this flag was never used.
>>
>> I've kept only FIEMAP_EXTENT_DATA_COMPRESSED, I don't see a need for
>> FIEMAP_EXTENT_PHYS_LENGTH and this would be yet another flag because the
>> FIEMAP_EXTENT_DATA_ENCODED is also implied.
>>
>> I'll send V4, we can discuss the PHYS_LENGTH flag then.
>
>
> Cheers, Andreas
>
>
>
>
>

Regards,
Rohan

<Prev in Thread] Current Thread [Next in Thread>