public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Qu Wenruo <wqu@suse.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 2/2] btrfs: get rid of btrfs_read_dev_super()
Date: Tue, 29 Apr 2025 09:17:07 +0200	[thread overview]
Message-ID: <20250429071707.GC18094@twin.jikos.cz> (raw)
In-Reply-To: <96a246471a1071b6cee00be2bcdbc7bc0e97787b.1745802753.git.wqu@suse.com>

On Mon, Apr 28, 2025 at 10:45:52AM +0930, Qu Wenruo wrote:
> The function is introduced by commit a512bbf855ff ("Btrfs: superblock
> duplication") at the beginning of btrfs.
> 
> It leaves a comment saying we need a special mount option to read all
> super blocks, but it's never implemented.
> 
> This means btrfs_read_dev_super() is always reading the first super
> block, making all the code finding the latest super block unnecessary.
> 
> Just remove that function and replace all call sites with
> btrfs_read_disk_super(bdev, 0, false).

I think it's ok to remove it, overwriting the primary superblock is
pointing to a worse problem that may not be simply fixed by starting
from the copies. The rescue tools or check have the ability to use the
copy and start from there.

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

      reply	other threads:[~2025-04-29  7:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-28  1:15 [PATCH 0/2] btrfs: merge the two different super block read functions into one Qu Wenruo
2025-04-28  1:15 ` [PATCH 1/2] btrfs: merge btrfs_read_dev_one_super() into btrfs_read_disk_super() Qu Wenruo
2025-04-28 14:21   ` Johannes Thumshirn
2025-04-28 23:11     ` Qu Wenruo
2025-04-29  7:14   ` David Sterba
2025-04-29  7:22   ` David Sterba
2025-04-29  7:39     ` Qu Wenruo
2025-04-28  1:15 ` [PATCH 2/2] btrfs: get rid of btrfs_read_dev_super() Qu Wenruo
2025-04-29  7:17   ` David Sterba [this message]

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=20250429071707.GC18094@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --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