From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f66.google.com ([74.125.83.66]:51552 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751607AbdJSJiv (ORCPT ); Thu, 19 Oct 2017 05:38:51 -0400 Received: by mail-pg0-f66.google.com with SMTP id p9so6728736pgc.8 for ; Thu, 19 Oct 2017 02:38:51 -0700 (PDT) Date: Thu, 19 Oct 2017 18:38:44 +0900 Message-ID: <87a80npjdn.wl-satoru.takeuchi@gmail.com> From: Satoru Takeuchi To: Qu Wenruo Cc: "Misono, Tomohiro" , Satoru Takeuchi , linux-btrfs@vger.kernel.org Subject: Re: [PATCH] btrfs-progs: change mans to describe the third copy of superblock In-Reply-To: References: <87y3o7zikq.wl-satoru.takeuchi@gmail.com> <1451864a-8a7a-9cdc-d507-fb4f10059dea@jp.fujitsu.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=ISO-2022-JP Sender: linux-btrfs-owner@vger.kernel.org List-ID: 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 " > >> 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 > >