diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2025-05-07 16:40:18 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2025-05-07 16:41:50 -0400 |
commit | 147fb2ac5dc4f08c38c5011ea1a99c2298abb280 (patch) | |
tree | e83b4d0b8a980292b18e3ef505a92e28ae2b33c4 /libbcachefs/extents.c | |
parent | 51315289f249fa5569a776eaa98c7ee557b61077 (diff) |
Update bcachefs sources to 17baec961add fixup! bcachefs: opts.rebalance_on_ac_onlynoradtux-debug
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'libbcachefs/extents.c')
-rw-r--r-- | libbcachefs/extents.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libbcachefs/extents.c b/libbcachefs/extents.c index 2d41260a..d3af841e 100644 --- a/libbcachefs/extents.c +++ b/libbcachefs/extents.c @@ -1140,6 +1140,7 @@ void bch2_extent_ptr_set_cached(struct bch_fs *c, union bch_extent_entry *entry; struct extent_ptr_decoded p; bool have_cached_ptr; + unsigned drop_dev = ptr->dev; rcu_read_lock(); restart_drop_ptrs: @@ -1157,6 +1158,7 @@ restart_drop_ptrs: if (p.ptr.cached) { if (have_cached_ptr || !want_cached_ptr(c, opts, &p.ptr)) { bch2_bkey_drop_ptr_noerror(k, &entry->ptr); + ptr = NULL; goto restart_drop_ptrs; } @@ -1164,6 +1166,11 @@ restart_drop_ptrs: } } + if (!ptr) + bkey_for_each_ptr(ptrs, ptr2) + if (ptr2->dev == drop_dev) + ptr = ptr2; + if (have_cached_ptr || !want_cached_ptr(c, opts, ptr)) goto drop; |