public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Ferry Toth <fntoth@gmail.com>
To: "Qu Wenruo" <wqu@suse.com>,
	𝕍𝕖𝕝𝕠𝕔𝕚𝕗𝕪𝕖𝕣 <velocifyer@velocifyer.com>,
	linux-btrfs@vger.kernel.org
Subject: Re: Why does defragmenting break reflinks?
Date: Wed, 4 Jun 2025 23:36:37 +0200	[thread overview]
Message-ID: <3fea5116-8532-4076-a824-620dc4c5a627@gmail.com> (raw)
In-Reply-To: <b407459f-5c9b-49e8-ab77-07768cb30783@suse.com>

Op 30-05-2025 om 02:27 schreef Qu Wenruo:
> 
> 
> 在 2025/5/30 09:22, 𝕍𝕖𝕝𝕠𝕔𝕚𝕗𝕪𝕖𝕣 写道:
>> BTRFS-FILESYSTEM(8) says "defragmenting  with  Linux kernel versions < 
>> 3.9 or ≥ 3.14-rc2 as well as with Linux stable kernel versions ≥ 
>> 3.10.31, ≥ 3.12.12 or ≥ 3.13.4 will break up the reflinks of COW data 
>> (for example files copied with cp --reflink, snapshots or de- 
>> duplicated data)." Why does defragmenting not preserve reflinks and 
>> why was it removed?
>>
> 
> Defrag means to re-dirty the data, and write them back again, which will 
> cause COW.

That sounds like an implementation choice.

> And by nature this breaks reflinked data extents.

With a different implementation this would not by nature be the case.

Actually this makes defrag a very dangerous operation on disks with many 
snapshots (> 20). When you would defrag each snapshot suddenly your 5% 
full disk would be 100%.

  parent reply	other threads:[~2025-06-04 21:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-29 23:52 Why does defragmenting break reflinks? 𝕍𝕖𝕝𝕠𝕔𝕚𝕗𝕪𝕖𝕣
2025-05-30  0:27 ` Qu Wenruo
2025-05-30 22:41   ` 𝕍𝕖𝕝𝕠𝕔𝕚𝕗𝕪𝕖𝕣
     [not found]   ` <3eabd123-e2a8-4554-b57b-0c84b713cd10@velocifyer.com>
2025-05-30 22:53     ` Qu Wenruo
2025-06-04 21:36   ` Ferry Toth [this message]
2025-06-04 21:54     ` 𝕍𝕖𝕝𝕠𝕔𝕚𝕗𝕪𝕖𝕣
2025-06-05  8:17       ` Christopher Snowhill

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=3fea5116-8532-4076-a824-620dc4c5a627@gmail.com \
    --to=fntoth@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=velocifyer@velocifyer.com \
    --cc=wqu@suse.com \
    /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