summaryrefslogtreecommitdiffstats
path: root/fs/btrfs
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.cz>2012-02-17 12:26:09 +0100
committerChris Mason <chris.mason@oracle.com>2012-03-28 20:30:28 -0400
commit65139ed99234d8505948cdb7a835452eb5c191f9 (patch)
tree92e2c5e62c55d19bbac1a74e1699321323e65542 /fs/btrfs
parentfcd1f065daca593badb7f99d473639cf3b551795 (diff)
btrfs: disallow unequal data/metadata blocksize for mixed block groups
With support for bigger metadata blocks, we must avoid mounting a filesystem with different block size for mixed block groups, this causes corruption (found by xfstests/083). Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/disk-io.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 38c2ee1ca0d..fe087847c8e 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -2302,6 +2302,14 @@ int open_ctree(struct super_block *sb,
goto fail_sb_buffer;
}
+ if ((features & BTRFS_FEATURE_INCOMPAT_MIXED_GROUPS) &&
+ (leafsize != nodesize || sectorsize != nodesize)) {
+ printk(KERN_WARNING "btrfs: unequal leaf/node/sector sizes "
+ "are not allowed for mixed block groups on %s\n",
+ sb->s_id);
+ goto fail_sb_buffer;
+ }
+
mutex_lock(&fs_info->chunk_mutex);
ret = btrfs_read_sys_array(tree_root);
mutex_unlock(&fs_info->chunk_mutex);