summaryrefslogtreecommitdiff
path: root/libbcachefs/super-io.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2018-02-07 06:16:50 -0500
committerKent Overstreet <kent.overstreet@gmail.com>2018-02-07 06:16:50 -0500
commit1ef243e3ad33dcc31fbdc44a940a0de56ee02037 (patch)
tree0c8ae96775a81edfe4f50768d231aad30132c67f /libbcachefs/super-io.c
parent99adc23cf6260a8e5b237f498119ee163d8f71f6 (diff)
Update bcachefs sources to 496cbe9474 bcachefs: export bch2_alloc_write()
Diffstat (limited to 'libbcachefs/super-io.c')
-rw-r--r--libbcachefs/super-io.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libbcachefs/super-io.c b/libbcachefs/super-io.c
index e3c319fc..1f266ba3 100644
--- a/libbcachefs/super-io.c
+++ b/libbcachefs/super-io.c
@@ -1077,6 +1077,11 @@ static int bch2_check_mark_super_slowpath(struct bch_fs *c,
/* allocations done, now commit: */
+ if (new_r)
+ bch2_write_super(c);
+
+ /* don't update in memory replicas until changes are persistent */
+
if (new_gc) {
rcu_assign_pointer(c->replicas_gc, new_gc);
kfree_rcu(old_gc, rcu);
@@ -1085,7 +1090,6 @@ static int bch2_check_mark_super_slowpath(struct bch_fs *c,
if (new_r) {
rcu_assign_pointer(c->replicas, new_r);
kfree_rcu(old_r, rcu);
- bch2_write_super(c);
}
mutex_unlock(&c->sb_lock);