Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Qu Wenruo <wqu@suse.com>
Cc: linux-btrfs@vger.kernel.org, "Jaron Viëtor" <jaron@vietors.com>
Subject: Re: [PATCH] btrfs: do not reject a valid running dev-replace
Date: Wed, 1 Apr 2026 02:17:11 +0200	[thread overview]
Message-ID: <20260401001711.GD5735@twin.jikos.cz> (raw)
In-Reply-To: <03c15f51597e61c4d669db55f5c627b3a3af9b20.1774998167.git.wqu@suse.com>

On Wed, Apr 01, 2026 at 09:32:57AM +1030, Qu Wenruo wrote:
> [BUG]
> There is a bug report that a btrfs with running dev-replace got rejected
> with the following messages:
> 
>  BTRFS error (device sdk1): devid 0 path /dev/sdk1 is registered but not found in chunk tree
>  BTRFS error (device sdk1): remove the above devices or use 'btrfs device scan --forget <dev>' to unregister them before mount
>  BTRFS error (device sdk1): open_ctree failed: -117
> 
> [CAUSE]
> The tree and super block dumps show the fs is completely sane, except
> one thing, there is no dev item for devid 0 in chunk tree.
> 
> However this is not a bug, as we do not insert dev item for devid 0 in
> the first place.
> Since the devid 0 is only there temporarily we do not really need to
> insert a dev item for it and then later remove it again.
> 
> It is the commit 34308187395f ("btrfs: add extra device item checks at
> mount") adding a overly strict check that triggers a false alert and
> rejected the valid filesystem.
> 
> [FIX]
> Add a special handling for devid 0, and doesn't require devid 0 to
> have a device item in chunk tree.
> 
> Reported-by: Jaron Viëtor <jaron@vietors.com>
> Link: https://lore.kernel.org/linux-btrfs/CAF1bhLVYLZvD=j2XyuxXDKD-NWNJAwDnpVN+UYeQW-HbzNRn1A@mail.gmail.com/
> Fixes: 34308187395f ("btrfs: add extra device item checks at mount")
> Signed-off-by: Qu Wenruo <wqu@suse.com>

Reviewed-by: David Sterba <dsterba@suse.com>

  reply	other threads:[~2026-04-01  0:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-31 23:02 [PATCH] btrfs: do not reject a valid running dev-replace Qu Wenruo
2026-04-01  0:17 ` David Sterba [this message]
2026-04-01 13:09 ` Anand Jain

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=20260401001711.GD5735@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=jaron@vietors.com \
    --cc=linux-btrfs@vger.kernel.org \
    --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