From: Chris Mason <clm@fb.com>
To: Qu Wenruo <quwenruo@cn.fujitsu.com>, <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH RFC] btrfs: Use backup superblocks if and only if the first superblock is valid but corrupted.
Date: Thu, 24 Jul 2014 17:28:40 -0400 [thread overview]
Message-ID: <53D17A88.5090905@fb.com> (raw)
In-Reply-To: <1403841234-10393-1-git-send-email-quwenruo@cn.fujitsu.com>
On 06/26/2014 11:53 PM, Qu Wenruo wrote:
> Current btrfs will only use the first superblock, making the backup
> superblocks only useful for 'btrfs rescue super' command.
>
> The old problem is that if we use backup superblocks when the first
> superblock is not valid, we will be able to mount a none btrfs
> filesystem, which used to contains btrfs but other fs is made on it.
>
> The old problem can be solved related easily by checking the first
> superblock in a special way:
> 1) If the magic number in the first superblock does not match:
> This filesystem is not btrfs anymore, just exit.
> If end-user consider it's really btrfs, then old 'btrfs rescue super'
> method is still available.
>
> 2) If the magic number in the first superblock matches but checksum does
> not match:
> This filesystem is btrfs but first superblock is corrupted, use
> backup roots. Just continue searching remaining superblocks.
I do agree that in these cases we can trust that the backup superblock
comes from the same filesystem.
But, for right now I'd prefer the admin get involved in using the backup
supers. I think silently using the backups is going to lead to surprises.
Thanks!
-chris
next prev parent reply other threads:[~2014-07-24 21:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-27 3:53 [PATCH RFC] btrfs: Use backup superblocks if and only if the first superblock is valid but corrupted Qu Wenruo
2014-07-24 21:28 ` Chris Mason [this message]
2014-07-27 2:57 ` Austin S Hemmelgarn
2014-07-28 0:29 ` Qu Wenruo
2014-07-28 2:53 ` Austin S Hemmelgarn
2014-08-19 17:29 ` David Sterba
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=53D17A88.5090905@fb.com \
--to=clm@fb.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=quwenruo@cn.fujitsu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.