with debug we could confirm that other fields in the backup superblock are invalid,
such as the device size, which was not checked for not being a whole-disk device,
and the bytes length, which is greater than the superblock structure size (8243 vs 1024).
so, the fix to check for the bytes field not being out-of-range resolves this case.
primary superblock
586: libblkid: LOWPROBE: nilfs2: nilfs_valid_sb:77 :: entry
586: libblkid: LOWPROBE: nilfs2: nilfs_valid_sb:80 :: not sb or not magic
with debug we could confirm that other fields in the backup superblock are invalid,
such as the device size, which was not checked for not being a whole-disk device,
and the bytes length, which is greater than the superblock structure size (8243 vs 1024).
so, the fix to check for the bytes field not being out-of-range resolves this case.
primary superblock
586: libblkid: LOWPROBE: nilfs2: nilfs_valid_sb:77 :: entry
586: libblkid: LOWPROBE: nilfs2: nilfs_valid_sb:80 :: not sb or not magic
backup superblock 296_366_ 616_623
586: libblkid: LOWPROBE: nilfs2: nilfs_valid_sb:77 :: entry
586: libblkid: LOWPROBE: nilfs2: nilfs_valid_sb:84 :: is_bak 1
586: libblkid: LOWPROBE: nilfs2: nilfs_valid_sb:85 :: is_wholedisk 0
586: libblkid: LOWPROBE: nilfs2: nilfs_valid_sb:86 :: sb->s_dev_size 3_472_328_
586: libblkid: LOWPROBE: nilfs2: nilfs_valid_sb:87 :: pr->size 1_072_693_248
586: libblkid: LOWPROBE: nilfs2: nilfs_valid_sb:96 :: bytes 8243
586: libblkid: LOWPROBE: incorrect checksum for type nilfs2, got 56C7A81B, expected 2D2D206B
586: libblkid: LOWPROBE: assigning SBBADCSUM [superblocks]
586: libblkid: LOWPROBE: nilfs2: primary=0, backup=1
586: libblkid: LOWPROBE: nilfs2: primary=0, backup=1, swap=1