summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2020-08-12 13:48:02 -0400
committerKent Overstreet <kent.overstreet@gmail.com>2020-08-12 13:56:07 -0400
commit579cc3e91e852300feff6b2167c90cfd80782903 (patch)
tree3aa4c185aa6941f4725a0c56fc4bfdeb0e0c51c0
parent83bae418fe3a68dee3a1714009ea30a8e4aa1348 (diff)
bcachefs: Don't block on allocations when only writing to specific device
Since the copygc thread is now global and not per device, we're not freeing up space on any one device in bounded time - and indeed we never really were, since rebalance wasn't moving data around between devices with that objective. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
-rw-r--r--fs/bcachefs/io.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/bcachefs/io.c b/fs/bcachefs/io.c
index 1d6f0e4e7cb3..92d2ec5662a5 100644
--- a/fs/bcachefs/io.c
+++ b/fs/bcachefs/io.c
@@ -1092,6 +1092,11 @@ again:
goto err;
}
+ /*
+ * The copygc thread is now global, which means it's no longer
+ * freeing up space on specific disks, which means that
+ * allocations for specific disks may hang arbitrarily long:
+ */
wp = bch2_alloc_sectors_start(c,
op->target,
op->opts.erasure_code,
@@ -1101,7 +1106,8 @@ again:
op->nr_replicas_required,
op->alloc_reserve,
op->flags,
- (op->flags & BCH_WRITE_ALLOC_NOWAIT) ? NULL : cl);
+ (op->flags & (BCH_WRITE_ALLOC_NOWAIT|
+ BCH_WRITE_ONLY_SPECIFIED_DEVS)) ? NULL : cl);
EBUG_ON(!wp);
if (unlikely(IS_ERR(wp))) {