summaryrefslogtreecommitdiff
path: root/fs/btrfs/disk-io.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@fusionio.com>2013-05-07 11:00:13 -0400
committerChris Mason <chris.mason@fusionio.com>2013-05-07 11:00:13 -0400
commit667e7d94a1683661cff5fe9a0fa0d7f8fdd2c007 (patch)
treecfb87693ac910d328ab82b4723c43ebd2433f9b9 /fs/btrfs/disk-io.c
parent1104a8855109a4051d74977f819a13b4516aa11e (diff)
downloadlwn-667e7d94a1683661cff5fe9a0fa0d7f8fdd2c007.tar.gz
lwn-667e7d94a1683661cff5fe9a0fa0d7f8fdd2c007.zip
Btrfs: allow superblock mismatch from older mkfs
We've added new checks to make sure the super block crc is correct during mount. A fresh filesystem from an older mkfs won't have the crc set. This adds a warning when it finds a newly created filesystem but doesn't fail the mount. Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r--fs/btrfs/disk-io.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index bc423f7eddce..4e9ebe1f1827 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -383,6 +383,11 @@ static int btrfs_check_super_csum(char *raw_disk_sb)
if (memcmp(raw_disk_sb, result, csum_size))
ret = 1;
+
+ if (ret && btrfs_super_generation(disk_sb) < 10) {
+ printk(KERN_WARNING "btrfs: super block crcs don't match, older mkfs detected\n");
+ ret = 0;
+ }
}
if (csum_type >= ARRAY_SIZE(btrfs_csum_sizes)) {