diff options
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r-- | fs/btrfs/disk-io.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 0a5350573f61..8d7866b733d6 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -877,6 +877,12 @@ static int __setup_root(u32 nodesize, u32 leafsize, u32 sectorsize, | |||
877 | root->defrag_running = 0; | 877 | root->defrag_running = 0; |
878 | root->defrag_level = 0; | 878 | root->defrag_level = 0; |
879 | root->root_key.objectid = objectid; | 879 | root->root_key.objectid = objectid; |
880 | root->anon_super.s_root = NULL; | ||
881 | root->anon_super.s_dev = 0; | ||
882 | INIT_LIST_HEAD(&root->anon_super.s_list); | ||
883 | INIT_LIST_HEAD(&root->anon_super.s_instances); | ||
884 | init_rwsem(&root->anon_super.s_umount); | ||
885 | |||
880 | return 0; | 886 | return 0; |
881 | } | 887 | } |
882 | 888 | ||
@@ -1083,6 +1089,9 @@ struct btrfs_root *btrfs_read_fs_root_no_name(struct btrfs_fs_info *fs_info, | |||
1083 | root = btrfs_read_fs_root_no_radix(fs_info->tree_root, location); | 1089 | root = btrfs_read_fs_root_no_radix(fs_info->tree_root, location); |
1084 | if (IS_ERR(root)) | 1090 | if (IS_ERR(root)) |
1085 | return root; | 1091 | return root; |
1092 | |||
1093 | set_anon_super(&root->anon_super, NULL); | ||
1094 | |||
1086 | ret = radix_tree_insert(&fs_info->fs_roots_radix, | 1095 | ret = radix_tree_insert(&fs_info->fs_roots_radix, |
1087 | (unsigned long)root->root_key.objectid, | 1096 | (unsigned long)root->root_key.objectid, |
1088 | root); | 1097 | root); |
@@ -1950,6 +1959,10 @@ int btrfs_free_fs_root(struct btrfs_fs_info *fs_info, struct btrfs_root *root) | |||
1950 | { | 1959 | { |
1951 | radix_tree_delete(&fs_info->fs_roots_radix, | 1960 | radix_tree_delete(&fs_info->fs_roots_radix, |
1952 | (unsigned long)root->root_key.objectid); | 1961 | (unsigned long)root->root_key.objectid); |
1962 | if (root->anon_super.s_dev) { | ||
1963 | down_write(&root->anon_super.s_umount); | ||
1964 | kill_anon_super(&root->anon_super); | ||
1965 | } | ||
1953 | if (root->in_sysfs) | 1966 | if (root->in_sysfs) |
1954 | btrfs_sysfs_del_root(root); | 1967 | btrfs_sysfs_del_root(root); |
1955 | if (root->node) | 1968 | if (root->node) |