summaryrefslogtreecommitdiff
path: root/libbcachefs/ec.c
diff options
context:
space:
mode:
Diffstat (limited to 'libbcachefs/ec.c')
-rw-r--r--libbcachefs/ec.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/libbcachefs/ec.c b/libbcachefs/ec.c
index 271e2521..89a95b6c 100644
--- a/libbcachefs/ec.c
+++ b/libbcachefs/ec.c
@@ -22,6 +22,7 @@
#include "io_write.h"
#include "keylist.h"
#include "lru.h"
+#include "rebalance.h"
#include "recovery.h"
#include "replicas.h"
#include "super-io.h"
@@ -1129,7 +1130,13 @@ static int ec_stripe_update_extent(struct btree_trans *trans,
(union bch_extent_entry *) ec_ptr,
(union bch_extent_entry *) &stripe_ptr);
- ret = bch2_trans_update(trans, &iter, n, 0);
+ struct bch_inode_opts opts;
+
+ ret = bch2_extent_get_io_opts_one(trans, &opts, &iter, bkey_i_to_s_c(n),
+ SET_NEEDS_REBALANCE_other) ?:
+ bch2_bkey_set_needs_rebalance(trans->c, &opts, n,
+ SET_NEEDS_REBALANCE_other, 0) ?:
+ bch2_trans_update(trans, &iter, n, 0);
out:
bch2_trans_iter_exit(&iter);
return ret;
@@ -1144,8 +1151,8 @@ static int ec_stripe_update_bucket(struct btree_trans *trans, struct ec_stripe_b
int ret = 0;
CLASS(bch2_dev_tryget, ca)(c, ptr.dev);
- if (!ca)
- return bch_err_throw(c, ENOENT_dev_not_found);
+ if (!ca) /* BCH_SB_MEMBER_INVALID */
+ return 0;
struct bpos bucket_pos = PTR_BUCKET_POS(ca, &ptr);