Skip to content

Commit 9cadb4e

Browse files
author
Kent Overstreet
committed
bcachefs: bch2_extent_normalize() -> bch2_dev_rcu()
Signed-off-by: Kent Overstreet <[email protected]>
1 parent 8e3cc20 commit 9cadb4e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

fs/bcachefs/extents.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -986,9 +986,14 @@ void bch2_extent_ptr_set_cached(struct bkey_s k, struct bch_extent_ptr *ptr)
986986
*/
987987
bool bch2_extent_normalize(struct bch_fs *c, struct bkey_s k)
988988
{
989+
struct bch_dev *ca;
990+
991+
rcu_read_lock();
989992
bch2_bkey_drop_ptrs(k, ptr,
990993
ptr->cached &&
991-
dev_ptr_stale(bch2_dev_bkey_exists(c, ptr->dev), ptr));
994+
(ca = bch2_dev_rcu(c, ptr->dev)) &&
995+
dev_ptr_stale_rcu(ca, ptr));
996+
rcu_read_unlock();
992997

993998
return bkey_deleted(k.k);
994999
}

0 commit comments

Comments
 (0)