linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Chris Laprise <tasket@posteo.net>
Cc: Christoph Hellwig <hch@infradead.org>,
	Demi Marie Obenour <demiobenour@gmail.com>,
	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, 29 Sep 2025 01:49:44 -0700	[thread overview]
Message-ID: <aNpIKB7cc7lCUy7j@infradead.org> (raw)
In-Reply-To: <d14d26ce-3176-4cd4-989e-cdbda30be98e@posteo.net>

On Mon, Sep 22, 2025 at 11:25:48PM +0000, Chris Laprise wrote:
> The overall procedure is:
> 
> 1. Get subvolume's Generation ID
> 
> 2. Read FIEMAP data
> 
> 3. Get subvolume's Generation ID again
> 
> 4. Check that the Generation ID hasn't changed: No match skips the file or
> raises an error

I'll let the btrfs developers answer this as it's clearly not about
XFS.

> I should clarify that in this application we are not interested in physical
> mappings, but the logical representation of data.

And that's not what FIEMAP provides.

> It is also understood that
> for some other applications FIEMAP would not be sufficient; however Wyng is
> not fetching or manipulating data at a low level.  Also, there is a lack of
> accuracy in the form of false positives, where unchanged data show up as
> deltas, but this only results in longer processing time not data corruption;
> false negatives are the only thing that must be avoided.

I think what you want/need is a way to look at the delta between two
reflinked files.  At least for XFS (and I'm pretty sure for btrfs as
well) the low-level data structures could provide this, but building an
actually safe interface to that is unfortunately hard.

  reply	other threads:[~2025-09-29  8:49 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
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 [this message]
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=aNpIKB7cc7lCUy7j@infradead.org \
    --to=hch@infradead.org \
    --cc=demiobenour@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=tasket@posteo.net \
    /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).