On Fri, Apr 16, 2021 at 05:52:41PM +0200, David Sterba wrote: > 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? OK, sure. I'll modify the mkfs.btrfs to reset the superblock log zone before writing out final superblock. > 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).