Btrfs: Release uuid_mutex for shrink during device delete
authorCarey Underwood <carey@scaletech.ca>
Mon, 4 Mar 2013 22:37:06 +0000 (16:37 -0600)
committerChris Mason <chris.mason@fusionio.com>
Sun, 1 Sep 2013 11:57:21 +0000 (07:57 -0400)
Device scanning waits on the uuid_mutex, which can result in a very long
wait if dev delete is shrinking the device.

Signed-off-by: Carey Underwood <cwillu@cwillu.com>
Reviewed-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
fs/btrfs/volumes.c

index 78b871753cb61e099abdfca27a0e316c37c329ee..b5c2b6acbf60677efd4a516c0c4002f2b38e763d 100644 (file)
@@ -1562,7 +1562,9 @@ int btrfs_rm_device(struct btrfs_root *root, char *device_path)
                clear_super = true;
        }
 
+       mutex_unlock(&uuid_mutex);
        ret = btrfs_shrink_device(device, 0);
+       mutex_lock(&uuid_mutex);
        if (ret)
                goto error_undo;