aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/volumes.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/volumes.c')
-rw-r--r--fs/btrfs/volumes.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 1546fa6f4f7d..b9e5c2d82dde 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -64,8 +64,8 @@ static void lock_chunks(struct btrfs_root *root)
64 64
65static void unlock_chunks(struct btrfs_root *root) 65static void unlock_chunks(struct btrfs_root *root)
66{ 66{
67 mutex_unlock(&root->fs_info->alloc_mutex);
68 mutex_unlock(&root->fs_info->chunk_mutex); 67 mutex_unlock(&root->fs_info->chunk_mutex);
68 mutex_unlock(&root->fs_info->alloc_mutex);
69} 69}
70 70
71int btrfs_cleanup_fs_uuids(void) 71int btrfs_cleanup_fs_uuids(void)
@@ -1668,8 +1668,13 @@ again:
1668 else 1668 else
1669 min_free = calc_size; 1669 min_free = calc_size;
1670 1670
1671 /* we add 1MB because we never use the first 1MB of the device */ 1671 /*
1672 min_free += 1024 * 1024; 1672 * we add 1MB because we never use the first 1MB of the device, unless
1673 * we've looped, then we are likely allocating the maximum amount of
1674 * space left already
1675 */
1676 if (!looped)
1677 min_free += 1024 * 1024;
1673 1678
1674 /* build a private list of devices we will allocate from */ 1679 /* build a private list of devices we will allocate from */
1675 while(index < num_stripes) { 1680 while(index < num_stripes) {