summaryrefslogtreecommitdiff
path: root/libbcachefs/ec.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2021-06-07 13:30:40 -0400
committerKent Overstreet <kent.overstreet@gmail.com>2021-06-08 22:55:14 -0400
commit58ae103b0a2b5d881d6e8ff68fe17bb822148ce7 (patch)
tree4c794fc614fdf2d5e2521d335ef721b4c17f1d1e /libbcachefs/ec.c
parentf6d87e9a87859dbf9b15269d4de165cf3aadf661 (diff)
Update bcachefs sources to e3a7cee503 bcachefs: Don't mark superblocks past end of usable space
Diffstat (limited to 'libbcachefs/ec.c')
-rw-r--r--libbcachefs/ec.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/libbcachefs/ec.c b/libbcachefs/ec.c
index fa7450d2..db6e4f6c 100644
--- a/libbcachefs/ec.c
+++ b/libbcachefs/ec.c
@@ -741,9 +741,8 @@ found_slot:
stripe->k.p = iter->pos;
- bch2_trans_update(&trans, iter, &stripe->k_i, 0);
-
- ret = bch2_trans_commit(&trans, res, NULL,
+ ret = bch2_trans_update(&trans, iter, &stripe->k_i, 0) ?:
+ bch2_trans_commit(&trans, res, NULL,
BTREE_INSERT_NOFAIL);
err:
bch2_trans_iter_put(&trans, iter);
@@ -791,7 +790,7 @@ static int ec_stripe_bkey_update(struct btree_trans *trans,
stripe_blockcount_set(&new->v, i,
stripe_blockcount_get(existing, i));
- bch2_trans_update(trans, iter, &new->k_i, 0);
+ ret = bch2_trans_update(trans, iter, &new->k_i, 0);
err:
bch2_trans_iter_put(trans, iter);
return ret;
@@ -864,9 +863,8 @@ static int ec_stripe_update_ptrs(struct bch_fs *c,
extent_stripe_ptr_add(e, s, ec_ptr, block);
bch2_btree_iter_set_pos(iter, bkey_start_pos(&sk.k->k));
- bch2_trans_update(&trans, iter, sk.k, 0);
-
- ret = bch2_trans_commit(&trans, NULL, NULL,
+ ret = bch2_trans_update(&trans, iter, sk.k, 0) ?:
+ bch2_trans_commit(&trans, NULL, NULL,
BTREE_INSERT_NOFAIL);
if (ret == -EINTR)
ret = 0;
@@ -1588,8 +1586,7 @@ write:
stripe_blockcount_set(&new_key->v, i,
m->block_sectors[i]);
- bch2_trans_update(trans, iter, &new_key->k_i, 0);
- return 0;
+ return bch2_trans_update(trans, iter, &new_key->k_i, 0);
}
int bch2_stripes_write(struct bch_fs *c, unsigned flags)