Skip to content

Commit

Permalink
Update bcachefs sources to 82792a451950 bcachefs: Switch some bch2_de…
Browse files Browse the repository at this point in the history
…v_rcu() calls to _noerror

Signed-off-by: Kent Overstreet <[email protected]>
  • Loading branch information
Kent Overstreet committed Sep 8, 2024
1 parent cd35891 commit bc5d903
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .bcachefs_revision
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ec2ddb95112b8967753591b16e2e439eee76c5b1
82792a451950397b8594b399bed03cfda1f31299
6 changes: 3 additions & 3 deletions libbcachefs/backpointers.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down
5 changes: 3 additions & 2 deletions libbcachefs/extents.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion libbcachefs/super-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit bc5d903

Please sign in to comment.