summaryrefslogtreecommitdiff
path: root/fs/bcachefs/buckets.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2020-07-22 23:11:48 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:08:45 -0400
commitb88e971e45fe61fba435c65cc2f66fb3a5136461 (patch)
tree3a97b6a5102cb98aeaddc52bd91da62cef35c0d5 /fs/bcachefs/buckets.c
parentaf4d05c46b1ef2b2b43e9df1924e204efe205ec6 (diff)
downloadlwn-b88e971e45fe61fba435c65cc2f66fb3a5136461.tar.gz
lwn-b88e971e45fe61fba435c65cc2f66fb3a5136461.zip
bcachefs: Don't drop replicas when copygcing ec data
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/buckets.c')
-rw-r--r--fs/bcachefs/buckets.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/bcachefs/buckets.c b/fs/bcachefs/buckets.c
index 2277143b1890..7558e2bffbdd 100644
--- a/fs/bcachefs/buckets.c
+++ b/fs/bcachefs/buckets.c
@@ -979,6 +979,9 @@ static int bucket_set_stripe(struct bch_fs *c, struct bkey_s_c k,
char buf[200];
int ret;
+ if (enabled)
+ g->ec_redundancy = s->nr_redundant;
+
old = bucket_cmpxchg(g, new, ({
ret = check_bucket_ref(c, k, ptr, 0, 0, new.gen, new.data_type,
new.dirty_sectors, new.cached_sectors);
@@ -1010,6 +1013,9 @@ static int bucket_set_stripe(struct bch_fs *c, struct bkey_s_c k,
}
}));
+ if (!enabled)
+ g->ec_redundancy = 0;
+
bch2_dev_usage_update(c, ca, fs_usage, old, new, gc);
return 0;
}