From c9163bb03b81e465019cf56d2edf47b70798e3ee Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Tue, 21 Feb 2023 19:22:44 -0500 Subject: bcachefs: Cached pointers should not be erasure coded There's no reason to erasure code cached pointers: we'll always have another copy, and it'll be cheaper to read the other copy than do a reconstruct read. And erasure coded cached pointers would add complications that we'd rather not have to deal with, so let's make sure to disallow them. Signed-off-by: Kent Overstreet --- fs/bcachefs/data_update.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'fs/bcachefs/data_update.c') diff --git a/fs/bcachefs/data_update.c b/fs/bcachefs/data_update.c index c3adc7b32e19..c98a393f4916 100644 --- a/fs/bcachefs/data_update.c +++ b/fs/bcachefs/data_update.c @@ -97,8 +97,10 @@ static void bch2_bkey_mark_dev_cached(struct bkey_s k, unsigned dev) struct bch_extent_ptr *ptr; bkey_for_each_ptr(ptrs, ptr) - if (ptr->dev == dev) - ptr->cached = true; + if (ptr->dev == dev) { + bch2_extent_ptr_set_cached(k, ptr); + return; + } } static int __bch2_data_update_index_update(struct btree_trans *trans, -- cgit v1.2.3