bcachefs: ec: fall back to creating new stripes for copygc
authorKent Overstreet <kent.overstreet@linux.dev>
Fri, 10 Mar 2023 21:46:24 +0000 (16:46 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:56 +0000 (17:09 -0400)
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/ec.c

index 4adbfd4855f772b18673f9f1d7f81526ac87be50..1fd68d44b90f29e924fe224ea1eeecd6127e5a16 100644 (file)
@@ -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;