From: Kent Overstreet Date: Fri, 10 Mar 2023 21:46:24 +0000 (-0500) Subject: bcachefs: ec: fall back to creating new stripes for copygc X-Git-Tag: io_uring-6.7-2023-11-10~119^2~428 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=10d9f7d2853d5e4c6f21a0dc96f6e98c2d0828e7;p=linux-block.git bcachefs: ec: fall back to creating new stripes for copygc Signed-off-by: Kent Overstreet --- diff --git a/fs/bcachefs/ec.c b/fs/bcachefs/ec.c index 4adbfd4855f7..1fd68d44b90f 100644 --- a/fs/bcachefs/ec.c +++ b/fs/bcachefs/ec.c @@ -1706,6 +1706,14 @@ struct ec_stripe_head *bch2_ec_stripe_head_get(struct btree_trans *trans, if (waiting || !cl || ret != -BCH_ERR_stripe_alloc_blocked) goto err; + if (reserve == RESERVE_movinggc) { + ret = new_stripe_alloc_buckets(trans, h, reserve, NULL) ?: + __bch2_ec_stripe_head_reserve(trans, h); + if (ret) + goto err; + goto allocate_buf; + } + /* XXX freelist_wait? */ closure_wait(&c->freelist_wait, cl); waiting = true;