From: Satoru Takeuchi <satoru.takeuchi@gmail.com>
To: Qu Wenruo <quwenruo.btrfs@gmx.com>
Cc: "Misono, Tomohiro" <misono.tomohiro@jp.fujitsu.com>,
Satoru Takeuchi <satoru.takeuchi@gmail.com>,
linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs-progs: change mans to describe the third copy of superblock
Date: Thu, 19 Oct 2017 18:38:44 +0900 [thread overview]
Message-ID: <87a80npjdn.wl-satoru.takeuchi@gmail.com> (raw)
In-Reply-To: <af16ecf9-2cc5-16bb-c5a8-977bcbdbc124@gmx.com>
At Thu, 19 Oct 2017 17:05:18 +0800,
Qu Wenruo wrote:
>
>
>
> On 2017年10月19日 16:34, Misono, Tomohiro wrote:
> > On 2017/10/19 16:45, Satoru Takeuchi wrote:
> >> Some tools can select which superblock these commands use by "-s <superblock>"
> >> option. Although this option says the valid values are 0-2, we can set 3
> >> if filesystem is very large.
> >>
> >
> > Hello,
> > Wiki says there are 4 superblocks. However in the implementation BTRFS_SUPER_MIROR_MAX
> > is 3 and 0 indicates the block at 64K (disk-io.h of btrfs-progs), therefore I think
> > there is no 4th superblock actually.
>
> Kernel implementation also shows that it will only update up to 3
> superblocks:
>
> ---
> if (max_mirrors == 0)
> max_mirrors = BTRFS_SUPER_MIRROR_MAX;
>
> for (i = 0; i < max_mirrors; i++) {
> bytenr = btrfs_sb_offset(i);
> if (bytenr + BTRFS_SUPER_INFO_SIZE >=
> device->commit_total_bytes)
> break;
> ---
>
> And BTRFS_SUPER_MIRROR_MAX is 3:
> ---
> #define BTRFS_SUPER_MIRROR_MAX 3
> ---
>
> So even you can set any value and btrfs_sb_offset() can calculate the
> super block offset, you will just read out some garbage.
My fault, sorry. I should read source more carefully. And thank you both
to let me know my mistake.
Thanks,
Satoru
>
> Thanks,
> Qu
> >
> > Regards,
> > Tomohiro
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
> >
prev parent reply other threads:[~2017-10-19 9:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-19 7:45 [PATCH] btrfs-progs: change mans to describe the third copy of superblock Satoru Takeuchi
2017-10-19 8:34 ` Misono, Tomohiro
2017-10-19 9:05 ` Qu Wenruo
2017-10-19 9:38 ` Satoru Takeuchi [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=87a80npjdn.wl-satoru.takeuchi@gmail.com \
--to=satoru.takeuchi@gmail.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=misono.tomohiro@jp.fujitsu.com \
--cc=quwenruo.btrfs@gmx.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;
as well as URLs for NNTP newsgroup(s).