From: Demi Marie Obenour <demiobenour@gmail.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: Can the output of FIEMAP on BTRFS be used to check if a file and its reflink copy might have diverged?
Date: Mon, 22 Sep 2025 13:54:56 -0400 [thread overview]
Message-ID: <0b428deb-3711-4671-96dd-69c149fd8ccb@gmail.com> (raw)
In-Reply-To: <aNGH9s0xoIg9Isk5@infradead.org>
[-- Attachment #1.1.1: Type: text/plain, Size: 1831 bytes --]
On 9/22/25 13:31, Christoph Hellwig wrote:
> On Mon, Sep 22, 2025 at 01:30:36PM -0400, Demi Marie Obenour wrote:
>> On 9/22/25 13:20, Christoph Hellwig wrote:
>>> On Mon, Sep 22, 2025 at 01:18:52PM -0400, Demi Marie Obenour wrote:
>>>> Is it safe on XFS if there is no RT device and both files have been
>>>> fsync'd and are not modified by userspace? I believe this is the case
>>>> here: reflinks are used to snapshot the files before they are looked at.
>>>
>>> No. Yo ucan still have defragementation or garbage collection going on
>>> underneath.
>>
>> Can these be prevented by mounting a read-only device-mapper snapshot,
>> replaying the journal, and then doing processing in userspace on the
>> block device?
>
> Which part of "looking at FIEMAP output except for debugging the file
> system is highly dangerous" did you not understand? Don't do it, you
> will lose data eventually.
I understand that FIEMAP is not to be used. This also explains why
BTRFS_IOCTL_TREE_SEARCH_V2 is privileged: there is no need for it to
be used in production.
This leaves the question of whether the needed information is in the
filesystem metadata. If so, xfsprogs and/or btrfsprogs could obtain
it from a block-layer snapshot offline without needing kernel changes.
Otherwise, kernel changes will be needed. I don't know if the changes
to the userspace tools will be accepted, though. Until then, btrfs
send/receive will be the only way to efficiently back up a BTRFS
filesystem, and XFS will only be able to be efficiently backed up
at the block level.
What makes thin_delta awesome is that it allows backing up a block
device *without having to read the entire device*. This makes
backups O(log N) instead of O(N) in the size of the device.
--
Sincerely,
Demi Marie Obenour (she/her/hers)
[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 7253 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2025-09-22 17:55 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-22 0:07 Can the output of FIEMAP on BTRFS be used to check if a file and its reflink copy might have diverged? Demi Marie Obenour
2025-09-22 0:50 ` Qu Wenruo
2025-09-22 18:24 ` Demi Marie Obenour
2025-09-22 21:38 ` Qu Wenruo
2025-09-22 16:48 ` Christoph Hellwig
2025-09-22 17:18 ` Demi Marie Obenour
2025-09-22 17:20 ` Christoph Hellwig
2025-09-22 17:30 ` Demi Marie Obenour
2025-09-22 17:31 ` Christoph Hellwig
2025-09-22 17:54 ` Demi Marie Obenour [this message]
2025-09-29 8:50 ` Christoph Hellwig
2025-09-29 23:56 ` Demi Marie Obenour
2025-09-30 1:34 ` Demi Marie Obenour
2025-10-03 7:45 ` Christoph Hellwig
2025-09-22 23:25 ` Chris Laprise
2025-09-29 8:49 ` Christoph Hellwig
2025-09-29 23:55 ` Demi Marie Obenour
2025-10-03 7:44 ` Christoph Hellwig
2025-10-04 1:09 ` Demi Marie Obenour
2025-10-04 1:43 ` Chris Laprise
2025-10-04 4:51 ` Christoph Hellwig
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=0b428deb-3711-4671-96dd-69c149fd8ccb@gmail.com \
--to=demiobenour@gmail.com \
--cc=hch@infradead.org \
--cc=linux-btrfs@vger.kernel.org \
/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).