linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Dilger <adilger@dilger.ca>
To: dsterba@suse.cz
Cc: "Darrick J. Wong" <djwong@kernel.org>,
	Sweet Tea Dorminy <sweettea-kernel@dorminy.me>,
	corbet@lwn.net, viro@zeniv.linux.org.uk, brauner@kernel.org,
	jack@suse.cz, linux-doc@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, linux-btrfs@vger.kernel.org,
	clm@meta.com, dsterba@suse.com, josef@toxicpanda.com,
	jbacik@toxicpanda.com, kernel-team@meta.com
Subject: Re: [PATCH 0/3] fiemap extension to add physical extent length
Date: Tue, 9 Apr 2024 13:57:13 -0600	[thread overview]
Message-ID: <86369AC8-3AAF-43C4-BB46-267A3EFDD293@dilger.ca> (raw)
In-Reply-To: <20240321185803.GH14596@suse.cz>

[-- Attachment #1: Type: text/plain, Size: 2331 bytes --]

On Mar 21, 2024, at 12:58 PM, David Sterba <dsterba@suse.cz> wrote:
> 
> On Thu, Mar 14, 2024 at 08:03:34PM -0700, Darrick J. Wong wrote:
>> On Fri, Mar 08, 2024 at 01:03:17PM -0500, Sweet Tea Dorminy wrote:
>>> For many years, various btrfs users have written programs to discover
>>> the actual disk space used by files, using root-only interfaces.
>>> However, this information is a great fit for fiemap: it is inherently
>>> tied to extent information, all filesystems can use it, and the
>>> capabilities required for FIEMAP make sense for this additional
>>> information also.
>>> 
>>> Hence, this patchset adds physical extent length information to fiemap,
>>> and extends btrfs to return it.  This uses some of the reserved padding
>>> in the fiemap extent structure, so programs unaware of the new field
>>> will be unaffected by its presence.
>>> 
>>> This is based on next-20240307. I've tested the btrfs part of this with
>>> the standard btrfs testing matrix locally, and verified that the physical extent
>>> information returned there is correct, but I'm still waiting on more
>>> tests. Please let me know what you think of the general idea!
>> 
>> Seems useful!  Any chance you'd be willing to pick up this old proposal
>> to report the dev_t through iomap?  iirc the iomap wrappers for fiemap
>> can export that pretty easily.
>> 
>> https://lore.kernel.org/linux-fsdevel/20190211094306.fjr6gfehcstm7eqq@hades.usersys.redhat.com/
> 
> I think this is not too useful for btrfs (in general) due to the block
> group profiles that store copies on multiple devices, we'd need more
> than one device identifier per extent.

My thought would be that there are multiple overlapping extents with the
same logical offset returned in this case.  It wouldn't just be the device
that would be different in this case, but also the physical offset may be
different on each device (depending on how allocation is done), and maybe
even the length and flags are different if one device stores compressed
data and another one does not.

Having multiple overlapping extents for files with built-in mirrors allows
freedom for all of the extent parameters to be different, doesn't have any
limits on the number of copies/devices that could fit in one extent, etc.

Cheers, Andreas






[-- Attachment #2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 873 bytes --]

      reply	other threads:[~2024-04-09 19:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-08 18:03 [PATCH 0/3] fiemap extension to add physical extent length Sweet Tea Dorminy
2024-03-08 18:03 ` [PATCH 1/3] fs: add physical_length field to fiemap extents Sweet Tea Dorminy
2024-03-12  0:22   ` [PATCH 1/3] " Andreas Dilger
2024-03-12  3:35     ` Eric Biggers
2024-03-13 15:05     ` Sweet Tea Dorminy
2024-03-08 18:03 ` [PATCH 2/3] fs: update fiemap_fill_next_extent() signature Sweet Tea Dorminy
2024-03-08 18:03 ` [PATCH 3/3] btrfs: fiemap: return extent physical size Sweet Tea Dorminy
2024-03-15  3:03 ` [PATCH 0/3] fiemap extension to add physical extent length Darrick J. Wong
2024-03-21 18:58   ` David Sterba
2024-04-09 19:57     ` Andreas Dilger [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86369AC8-3AAF-43C4-BB46-267A3EFDD293@dilger.ca \
    --to=adilger@dilger.ca \
    --cc=brauner@kernel.org \
    --cc=clm@meta.com \
    --cc=corbet@lwn.net \
    --cc=djwong@kernel.org \
    --cc=dsterba@suse.com \
    --cc=dsterba@suse.cz \
    --cc=jack@suse.cz \
    --cc=jbacik@toxicpanda.com \
    --cc=josef@toxicpanda.com \
    --cc=kernel-team@meta.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=sweettea-kernel@dorminy.me \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).