Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Mark Harmstone <mark@harmstone.com>
To: Filipe Manana <fdmanana@kernel.org>
Cc: dsterba@suse.cz, David Sterba <dsterba@suse.com>,
	linux-btrfs@vger.kernel.org
Subject: Re: Btrfs progs release 6.16.1
Date: Thu, 18 Sep 2025 14:05:13 +0100	[thread overview]
Message-ID: <eaf33285-5d77-4b7e-851a-61e40e61d3ae@harmstone.com> (raw)
In-Reply-To: <CAL3q7H4WX5XddPyQ2+0a8yQaCW757+V8VVVO6byscY9ch+LzQw@mail.gmail.com>

On 18/09/2025 1.17 pm, Filipe Manana wrote:
> On Thu, Sep 18, 2025 at 6:10 AM Mark Harmstone <mark@harmstone.com> wrote:
>>
>> On 18/09/2025 1.33 am, David Sterba wrote:
>>> On Wed, Sep 17, 2025 at 04:41:43PM +0100, Filipe Manana wrote:
>>>> With this btrfs-progs release, running 'btrfs check' fails on a
>>>> filesystem created by an older mkfs.btrfs.
>>>
>>>> A bisection points to:
>>>>
>>>> commit e2cf6a03796b73d446b086022c0dfcf6a6552928
>>>> Author: Mark Harmstone <maharmstone@fb.com>
>>>> Date:   Fri Jul 18 15:26:27 2025 +0100
>>>>
>>>>       btrfs-progs: use btrfs_lookup_block_group() in check_free_space_tree()
>>>
>>> Thanks for the report, I'll do a release with this patch reverted unless
>>> there's an updated fix.
>>
>> The patch is correct: older versions of mkfs were creating spurious
>> free-space entries. btrfs-check was supposed to diagnose this but there
>> was a bug that meant it only triggered for entries at the end of the tree.
> 
> Sure, but now we have btrfs check failing for every fs created up to
> btrfs-progs v16.0 since we have the free space tree feature.
> That makes scripts fail since btrfs check returns a non-zero status
> now for such fs.
> Do we have any code to remove those unnecessary and harmless free space entries?
> 
> This will confuse and potentially scare some users, besides breaking
> scripts that verify the result from btrfs check exit status.

To be clear, this patch does address an actual issue: it caused me problems
while developing btrfs-discard-check. Leo independently ran into it last year
too.

btrfs rescue clear-space-cache will get rid of the error, though it's
obviously a little heavy-handed. I don't know if btrfs check --repair fixes
the FST.

Maybe the thing to do is to add a compat_flag to say that the FST doesn't
contain spurious entries, and to clean these up and set the flag on mount
if it's not there - what do you think? Like we have for
BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE_VALID already, though compat rather
than compat_ro because the kernel won't create these entries itself.

  reply	other threads:[~2025-09-18 13:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-10 17:50 Btrfs progs release 6.16.1 David Sterba
2025-09-17 15:41 ` Filipe Manana
2025-09-18  0:33   ` David Sterba
2025-09-18  5:10     ` Mark Harmstone
2025-09-18 12:17       ` Filipe Manana
2025-09-18 13:05         ` Mark Harmstone [this message]
2025-09-21 18:25           ` Chris Murphy
2025-09-21 18:32             ` Chris Murphy

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=eaf33285-5d77-4b7e-851a-61e40e61d3ae@harmstone.com \
    --to=mark@harmstone.com \
    --cc=dsterba@suse.com \
    --cc=dsterba@suse.cz \
    --cc=fdmanana@kernel.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