]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: enhance superblock checks
authorDavid Sterba <dsterba@suse.cz>
Wed, 6 Mar 2013 14:57:46 +0000 (15:57 +0100)
committerChris Mason <chris.mason@fusionio.com>
Tue, 7 May 2013 14:50:27 +0000 (10:50 -0400)
commit7b32505a23dc02fe641df9c62f99d0283950a363
treec81894968089f010c293bbba501a18e6331204e1
parent6cf500a6210b9cc5bc83f889f3f90bc2cf7f2d97
btrfs: enhance superblock checks

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: David Sterba <dsterba@suse.cz>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
fs/btrfs/ctree.h
fs/btrfs/disk-io.c