On Wed, Apr 14, 2021 at 10:33:38AM +0900, Naohiro Aota wrote:
> It also supports temporary magic ("!BHRfS_M") in zone #0. The mkfs.btrfs
> first writes the temporary superblock to the zone during the mkfs process.
> It will survive there until the zones are filled up and reset. So, we also
> need to detect this temporary magic.
> + /*
> + * For zoned btrfs, we also need to detect a temporary superblock
> + * at zone #0. Mkfs.btrfs creates it in the initialize process.
> + * It persits until both zones are filled up then reset.
> + */
> + { .magic = "!BHRfS_M", .len = 8, .sboff = 0x40,
> + .is_zoned = 1, .zonenum = 0, .kboff_inzone = 0 },
Should we rather reset the zone twice so the initial superblock does not
have the temporary signature?
For the primary superblock at offset 64K and as a fallback the signature
should be valid for detection purposes (ie. not necessarily to get the
latest superblock).