diff --git a/volumes.c b/volumes.c
index a8b71de..92cec82 100644
--- a/volumes.c
+++ b/volumes.c
@@ -4802,6 +4802,8 @@ static int __btrfs_alloc_chunk(struct btrfs_trans_handle *trans,
 	u64 stripe_size;
 	u64 chunk_size;
 	int ndevs;
+	u64 fs_total_avail;
+	int ndevs_opt;
 	int i;
 	int j;
 	int index;
@@ -4860,6 +4862,7 @@ static int __btrfs_alloc_chunk(struct btrfs_trans_handle *trans,
 	 * about the available holes on each device.
 	 */
 	ndevs = 0;
+	fs_total_avail = 0;
 	list_for_each_entry(device, &fs_devices->alloc_list, dev_alloc_list) {
 		u64 max_avail;
 		u64 dev_offset;
@@ -4912,6 +4915,7 @@ static int __btrfs_alloc_chunk(struct btrfs_trans_handle *trans,
 		devices_info[ndevs].total_avail = total_avail;
 		devices_info[ndevs].dev = device;
 		++ndevs;
+		fs_total_avail += total_avail;	/* overflow? */
 	}
 
 	/*
@@ -4920,6 +4924,15 @@ static int __btrfs_alloc_chunk(struct btrfs_trans_handle *trans,
 	sort(devices_info, ndevs, sizeof(struct btrfs_device_info),
 	     btrfs_cmp_device_info, NULL);
 
+	/*
+	 * limit the number of stripes as needed to maximise useable space
+	 * only happens if the free space isn't balanced between the drives
+	 */
+	if (ndevs > 0 && devices_info[0].total_avail > 0) {
+		ndevs_opt = (fs_total_avail*2 + devs_increment*devices_info[0].total_avail)/(devices_info[0].total_avail*2);
+		ndevs = clamp_val(ndevs_opt, devs_min, ndevs);
+	}
+
 	/*
 	 * Round down to number of usable stripes, devs_increment can be any
 	 * number so we can't use round_down()
