]> rtime.felk.cvut.cz Git - linux-imx.git/commitdiff
Btrfs: fix crash in log replay with qgroups enabled
authorArne Jansen <sensille@gmx.net>
Wed, 13 Feb 2013 11:20:01 +0000 (04:20 -0700)
committerChris Mason <chris.mason@fusionio.com>
Fri, 15 Feb 2013 01:47:41 +0000 (20:47 -0500)
When replaying a log tree with qgroups enabled, tree_mod_log_rewind does a
sanity-check of the number of items against the maximum possible number.
It calculates that number with the nodesize of fs_root. Unfortunately
fs_root is not yet set at this stage. So instead use the nodesize from
tree_root, which is already initialized.

Signed-off-by: Arne Jansen <sensille@gmx.net>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
fs/btrfs/ctree.c

index eea5da7a2b9aa38ce28ee9b55d1c8ff5c141fa16..6eff0fa9ecaa7ed97c40e97771dfe205851b7c8a 100644 (file)
@@ -1222,7 +1222,7 @@ tree_mod_log_rewind(struct btrfs_fs_info *fs_info, struct extent_buffer *eb,
 
        __tree_mod_log_rewind(eb_rewin, time_seq, tm);
        WARN_ON(btrfs_header_nritems(eb_rewin) >
-               BTRFS_NODEPTRS_PER_BLOCK(fs_info->fs_root));
+               BTRFS_NODEPTRS_PER_BLOCK(fs_info->tree_root));
 
        return eb_rewin;
 }