• David Sterba's avatar
    btrfs: enhance superblock checks · 1104a885
    David Sterba authored
    The superblock checksum is not verified upon mount. <awkward silence>
    
    Add that check and also reorder existing checks to a more logical
    order.
    
    Current mkfs.btrfs does not calculate the correct checksum of
    super_block and thus a freshly created filesytem will fail to mount when
    this patch is applied.
    
    First transaction commit calculates correct superblock checksum and
    saves it to disk.
    
    Reproducer:
    $ mfks.btrfs /dev/sda
    $ mount /dev/sda /mnt
    $ btrfs scrub start /mnt
    $ sleep 5
    $ btrfs scrub status /mnt
    ... super:2 ...
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.cz>
    Signed-off-by: default avatarJosef Bacik <jbacik@fusionio.com>
    Signed-off-by: default avatarChris Mason <chris.mason@fusionio.com>
    1104a885
disk-io.c 108 KB