summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/data_update.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-02-22 01:22:44 +0100
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 23:09:54 +0200
commitc9163bb03b81e465019cf56d2edf47b70798e3ee (patch)
treefa4e29fa781b97bc47f7038c9d192f210f3b72bb /fs/bcachefs/data_update.c
parentbcachefs: Kill bch2_keylist_add_in_order() (diff)
downloadlinux-c9163bb03b81e465019cf56d2edf47b70798e3ee.tar.xz
linux-c9163bb03b81e465019cf56d2edf47b70798e3ee.zip
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 <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/data_update.c')
-rw-r--r--fs/bcachefs/data_update.c6
1 files changed, 4 insertions, 2 deletions
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,