From bc5d903fdae933fad017d370764e2ae38d58b42d Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Sat, 7 Sep 2024 21:31:45 -0400 Subject: [PATCH] Update bcachefs sources to 82792a451950 bcachefs: Switch some bch2_dev_rcu() calls to _noerror Signed-off-by: Kent Overstreet --- .bcachefs_revision | 2 +- libbcachefs/backpointers.c | 6 +++--- libbcachefs/extents.c | 5 +++-- libbcachefs/super-io.c | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.bcachefs_revision b/.bcachefs_revision index ec5195e12..929a59b5c 100644 --- a/.bcachefs_revision +++ b/.bcachefs_revision @@ -1 +1 @@ -ec2ddb95112b8967753591b16e2e439eee76c5b1 +82792a451950397b8594b399bed03cfda1f31299 diff --git a/libbcachefs/backpointers.c b/libbcachefs/backpointers.c index f1862c3f9..b88d18016 100644 --- a/libbcachefs/backpointers.c +++ b/libbcachefs/backpointers.c @@ -55,7 +55,7 @@ int bch2_backpointer_validate(struct bch_fs *c, struct bkey_s_c k, struct bkey_s_c_backpointer bp = bkey_s_c_to_backpointer(k); rcu_read_lock(); - struct bch_dev *ca = bch2_dev_rcu(c, bp.k->p.inode); + struct bch_dev *ca = bch2_dev_rcu_noerror(c, bp.k->p.inode); if (!ca) { /* these will be caught by fsck */ rcu_read_unlock(); @@ -89,7 +89,7 @@ void bch2_backpointer_to_text(struct printbuf *out, const struct bch_backpointer void bch2_backpointer_k_to_text(struct printbuf *out, struct bch_fs *c, struct bkey_s_c k) { rcu_read_lock(); - struct bch_dev *ca = bch2_dev_rcu(c, k.k->p.inode); + struct bch_dev *ca = bch2_dev_rcu_noerror(c, k.k->p.inode); if (ca) { struct bpos bucket = bp_pos_to_bucket(ca, k.k->p); rcu_read_unlock(); @@ -673,7 +673,7 @@ static int check_extent_to_backpointers(struct btree_trans *trans, continue; rcu_read_lock(); - struct bch_dev *ca = bch2_dev_rcu(c, p.ptr.dev); + struct bch_dev *ca = bch2_dev_rcu_noerror(c, p.ptr.dev); if (ca) bch2_extent_ptr_to_bp(c, ca, btree, level, k, p, entry, &bucket_pos, &bp); rcu_read_unlock(); diff --git a/libbcachefs/extents.c b/libbcachefs/extents.c index 5467d0f92..cc0d22085 100644 --- a/libbcachefs/extents.c +++ b/libbcachefs/extents.c @@ -1027,7 +1027,7 @@ void bch2_extent_ptr_to_text(struct printbuf *out, struct bch_fs *c, const struc { out->atomic++; rcu_read_lock(); - struct bch_dev *ca = bch2_dev_rcu(c, ptr->dev); + struct bch_dev *ca = bch2_dev_rcu_noerror(c, ptr->dev); if (!ca) { prt_printf(out, "ptr: %u:%llu gen %u%s", ptr->dev, (u64) ptr->offset, ptr->gen, @@ -1131,8 +1131,9 @@ static int extent_ptr_validate(struct bch_fs *c, { int ret = 0; + /* bad pointers are repaired by check_fix_ptrs(): */ rcu_read_lock(); - struct bch_dev *ca = bch2_dev_rcu(c, ptr->dev); + struct bch_dev *ca = bch2_dev_rcu_noerror(c, ptr->dev); if (!ca) { rcu_read_unlock(); return 0; diff --git a/libbcachefs/super-io.c b/libbcachefs/super-io.c index 77597fd71..d86d5dae5 100644 --- a/libbcachefs/super-io.c +++ b/libbcachefs/super-io.c @@ -524,7 +524,7 @@ static void bch2_sb_update(struct bch_fs *c) c->sb.time_units_per_sec = NSEC_PER_SEC / c->sb.nsec_per_time_unit; /* XXX this is wrong, we need a 96 or 128 bit integer type */ - c->sb.time_base_lo = div64_u64(le64_to_cpu(src->time_base_lo), + c->sb.time_base_lo = div_u64(le64_to_cpu(src->time_base_lo), c->sb.nsec_per_time_unit); c->sb.time_base_hi = le32_to_cpu(src->time_base_hi);