Btrfs: Fix uninitialized root flags for subvolumes
[linux-2.6-block.git] / fs / btrfs / disk-io.c
index 5cf3aa7b125c2686304b4bc2ec0449af33566166..a272bfd74ea083f1ee13cde42012dac8d28dc8cc 100644 (file)
@@ -1276,8 +1276,10 @@ struct btrfs_root *btrfs_read_fs_root_no_radix(struct btrfs_root *tree_root,
        root->commit_root = btrfs_root_node(root);
        BUG_ON(!root->node);
 out:
-       if (location->objectid != BTRFS_TREE_LOG_OBJECTID)
+       if (location->objectid != BTRFS_TREE_LOG_OBJECTID) {
                root->ref_cows = 1;
+               btrfs_check_and_init_root_item(&root->root_item);
+       }
 
        return root;
 }