Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 297918
b: refs/heads/master
c: bc3f116
h: refs/heads/master
v: v3
  • Loading branch information
Chris Mason committed Mar 29, 2012
1 parent 34137e3 commit 8551038
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e1f041e14cfb322f41f41a308bfede00f1b080cd
refs/heads/master: bc3f116fec194f1d7329b160c266fe16b9266a1e
29 changes: 17 additions & 12 deletions trunk/fs/btrfs/disk-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -2120,6 +2120,23 @@ int open_ctree(struct super_block *sb,
features |= BTRFS_FEATURE_INCOMPAT_BIG_METADATA;
}

nodesize = btrfs_super_nodesize(disk_super);
leafsize = btrfs_super_leafsize(disk_super);
sectorsize = btrfs_super_sectorsize(disk_super);
stripesize = btrfs_super_stripesize(disk_super);

/*
* mixed block groups end up with duplicate but slightly offset
* extent buffers for the same range. It leads to corruptions
*/
if ((features & BTRFS_FEATURE_INCOMPAT_MIXED_GROUPS) &&
(sectorsize != leafsize)) {
printk(KERN_WARNING "btrfs: unequal leaf/node/sector sizes "
"are not allowed for mixed block groups on %s\n",
sb->s_id);
goto fail_alloc;
}

btrfs_set_super_incompat_flags(disk_super, features);

features = btrfs_super_compat_ro_flags(disk_super) &
Expand Down Expand Up @@ -2223,10 +2240,6 @@ int open_ctree(struct super_block *sb,
fs_info->bdi.ra_pages = max(fs_info->bdi.ra_pages,
4 * 1024 * 1024 / PAGE_CACHE_SIZE);

nodesize = btrfs_super_nodesize(disk_super);
leafsize = btrfs_super_leafsize(disk_super);
sectorsize = btrfs_super_sectorsize(disk_super);
stripesize = btrfs_super_stripesize(disk_super);
tree_root->nodesize = nodesize;
tree_root->leafsize = leafsize;
tree_root->sectorsize = sectorsize;
Expand All @@ -2247,14 +2260,6 @@ 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);
Expand Down

0 comments on commit 8551038

Please sign in to comment.