diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2022-10-09 09:30:50 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-23 00:09:42 +0300 |
commit | 160dff6dad43d9428b1250f927721a9a8756cfd9 (patch) | |
tree | 22b213a6f2097d432e62ad3f9199ee4e2e933fa3 /fs/bcachefs/ec.c | |
parent | 2da671dc4a62da6de4ce0de529fc3e80f1f8f603 (diff) | |
download | linux-160dff6dad43d9428b1250f927721a9a8756cfd9.tar.xz |
bcachefs: Ratelimit ec error message
We should fix this, but for now this makes this more usable.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/ec.c')
-rw-r--r-- | fs/bcachefs/ec.c | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/fs/bcachefs/ec.c b/fs/bcachefs/ec.c index aa8301146382..2dcca5c7fcec 100644 --- a/fs/bcachefs/ec.c +++ b/fs/bcachefs/ec.c @@ -1386,10 +1386,8 @@ static int __bch2_ec_stripe_head_reuse(struct bch_fs *c, int ret; idx = get_existing_stripe(c, h); - if (idx < 0) { - bch_err(c, "failed to find an existing stripe"); + if (idx < 0) return -BCH_ERR_ENOSPC_stripe_reuse; - } h->s->have_existing_stripe = true; ret = get_stripe_key(c, idx, &h->s->existing_stripe); @@ -1427,21 +1425,9 @@ static int __bch2_ec_stripe_head_reuse(struct bch_fs *c, static int __bch2_ec_stripe_head_reserve(struct bch_fs *c, struct ec_stripe_head *h) { - int ret; - - ret = bch2_disk_reservation_get(c, &h->s->res, - h->blocksize, - h->s->nr_parity, 0); - - if (ret) { - /* - * This means we need to wait for copygc to - * empty out buckets from existing stripes: - */ - bch_err(c, "failed to reserve stripe"); - } - - return ret; + return bch2_disk_reservation_get(c, &h->s->res, + h->blocksize, + h->s->nr_parity, 0); } struct ec_stripe_head *bch2_ec_stripe_head_get(struct bch_fs *c, @@ -1483,8 +1469,10 @@ struct ec_stripe_head *bch2_ec_stripe_head_get(struct bch_fs *c, ret = __bch2_ec_stripe_head_reserve(c, h); if (ret && needs_stripe_new) ret = __bch2_ec_stripe_head_reuse(c, h); - if (ret) + if (ret) { + bch_err_ratelimited(c, "failed to get stripe: %s", bch2_err_str(ret)); goto err; + } if (!h->s->allocated) { ret = new_stripe_alloc_buckets(c, h, cl); |