]> git.hungrycats.org Git - linux/commitdiff
Revert "zygo: btrfs: don't let btrfs_recover_relocation get stuck waiting for cleaner...
authorZygo Blaxell <zblaxell@thirteen.furryterror.org>
Thu, 5 May 2016 00:56:47 +0000 (20:56 -0400)
committerZygo Blaxell <zblaxell@thirteen.furryterror.org>
Thu, 5 May 2016 00:56:47 +0000 (20:56 -0400)
This reverts commit f973d661d2c89be39452df49a7ee3a4e3074d8f4.

fs/btrfs/disk-io.c

index af5ea1dd8f48aeed10129e3c2ab52291549fb33b..07c1ad6444d5cdf16e78a7beae02b05db79c0c8b 100644 (file)
@@ -2927,10 +2927,6 @@ retry_root_backup:
                        "too many missing devices, writeable mount should not be allowed\n");
        }
 
-       /* Hold the cleaner_mutex thread here so that we don't block
-        * on btrfs_recover_relocation later on.  cleaner_kthread
-        * blocks on us instead. */
-       mutex_lock(&fs_info->cleaner_mutex);
        fs_info->cleaner_kthread = kthread_run(cleaner_kthread, tree_root,
                                               "btrfs-cleaner");
        if (IS_ERR(fs_info->cleaner_kthread))
@@ -2990,8 +2986,9 @@ retry_root_backup:
                if (ret)
                        goto fail_qgroup;
 
-               /* We grabbed this mutex before we created the cleaner_kthread */
+               mutex_lock(&fs_info->cleaner_mutex);
                ret = btrfs_recover_relocation(tree_root);
+               mutex_unlock(&fs_info->cleaner_mutex);
                if (ret < 0) {
                        printk(KERN_WARNING
                               "BTRFS: failed to recover relocation\n");
@@ -2999,7 +2996,6 @@ retry_root_backup:
                        goto fail_qgroup;
                }
        }
-       mutex_unlock(&fs_info->cleaner_mutex);
 
        location.objectid = BTRFS_FS_TREE_OBJECTID;
        location.type = BTRFS_ROOT_ITEM_KEY;
@@ -3083,7 +3079,6 @@ fail_cleaner:
        filemap_write_and_wait(fs_info->btree_inode->i_mapping);
 
 fail_sysfs:
-       mutex_unlock(&fs_info->cleaner_mutex);
        btrfs_sysfs_remove_one(fs_info);
 
 fail_block_groups: