diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2020-07-22 23:11:48 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:08:45 -0400 |
commit | b88e971e45fe61fba435c65cc2f66fb3a5136461 (patch) | |
tree | 3a97b6a5102cb98aeaddc52bd91da62cef35c0d5 /fs/bcachefs/buckets.c | |
parent | af4d05c46b1ef2b2b43e9df1924e204efe205ec6 (diff) | |
download | lwn-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.c | 6 |
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; } |