Btrfs: Properly setup root key while reading the root
[deliverable/linux.git] / fs / btrfs / disk-io.c
index 1176e5420c56d532bb05fb5f7dce22f80d0169de..5a7e60d7f443044cb457ec637dadabdad96c36e9 100644 (file)
@@ -410,6 +410,7 @@ struct btrfs_root *btrfs_read_fs_root_no_radix(struct btrfs_fs_info *fs_info,
        read_extent_buffer(l, &root->root_item,
               btrfs_item_ptr_offset(l, path->slots[0]),
               sizeof(root->root_item));
+       memcpy(&root->root_key, location, sizeof(*location));
        ret = 0;
 out:
        btrfs_release_path(root, path);
@@ -594,6 +595,7 @@ struct btrfs_root *open_ctree(struct super_block *sb)
        tree_root->nodesize = nodesize;
        tree_root->leafsize = leafsize;
        tree_root->sectorsize = sectorsize;
+       sb_set_blocksize(sb, sectorsize);
 
        i_size_write(fs_info->btree_inode,
                     btrfs_super_total_bytes(disk_super));
@@ -768,7 +770,7 @@ void btrfs_mark_buffer_dirty(struct extent_buffer *buf)
 void btrfs_btree_balance_dirty(struct btrfs_root *root, unsigned long nr)
 {
        balance_dirty_pages_ratelimited_nr(
-                       root->fs_info->btree_inode->i_mapping, nr);
+                       root->fs_info->btree_inode->i_mapping, 1);
 }
 
 void btrfs_set_buffer_defrag(struct extent_buffer *buf)
This page took 0.036588 seconds and 5 git commands to generate.