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.
Thanks,
Qu
>
> Regards,
> Tomohiro
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html