mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-27 09:02:06 +00:00
btrfs: Don't use objectid_mutex during mount
Since the filesystem is not well formed and no trees are loaded it's pointless holding the objectid_mutex. Just remove its usage. Signed-off-by: Nikolay Borisov <nborisov@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
b8522a1e5f
commit
336a0d8df1
1 changed files with 4 additions and 3 deletions
|
@ -2666,17 +2666,18 @@ int __cold init_tree_roots(struct btrfs_fs_info *fs_info)
|
||||||
tree_root->commit_root = btrfs_root_node(tree_root);
|
tree_root->commit_root = btrfs_root_node(tree_root);
|
||||||
btrfs_set_root_refs(&tree_root->root_item, 1);
|
btrfs_set_root_refs(&tree_root->root_item, 1);
|
||||||
|
|
||||||
mutex_lock(&tree_root->objectid_mutex);
|
/*
|
||||||
|
* No need to hold btrfs_root::objectid_mutex since the fs
|
||||||
|
* hasn't been fully initialised and we are the only user
|
||||||
|
*/
|
||||||
ret = btrfs_find_highest_objectid(tree_root,
|
ret = btrfs_find_highest_objectid(tree_root,
|
||||||
&tree_root->highest_objectid);
|
&tree_root->highest_objectid);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
mutex_unlock(&tree_root->objectid_mutex);
|
|
||||||
handle_error = true;
|
handle_error = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
ASSERT(tree_root->highest_objectid <= BTRFS_LAST_FREE_OBJECTID);
|
ASSERT(tree_root->highest_objectid <= BTRFS_LAST_FREE_OBJECTID);
|
||||||
mutex_unlock(&tree_root->objectid_mutex);
|
|
||||||
|
|
||||||
ret = btrfs_read_roots(fs_info);
|
ret = btrfs_read_roots(fs_info);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue