btrfs: zoned: fix deadlock on log sync
[platform/kernel/linux-rpi.git] / fs / btrfs / tree-log.c
index d90695c..2f1acc9 100644 (file)
@@ -3174,16 +3174,13 @@ int btrfs_sync_log(struct btrfs_trans_handle *trans,
        root_log_ctx.log_transid = log_root_tree->log_transid;
 
        if (btrfs_is_zoned(fs_info)) {
-               mutex_lock(&fs_info->tree_root->log_mutex);
                if (!log_root_tree->node) {
                        ret = btrfs_alloc_log_tree_node(trans, log_root_tree);
                        if (ret) {
-                               mutex_unlock(&fs_info->tree_log_mutex);
                                mutex_unlock(&log_root_tree->log_mutex);
                                goto out;
                        }
                }
-               mutex_unlock(&fs_info->tree_root->log_mutex);
        }
 
        /*