diff options
| author | Kent Overstreet <kent.overstreet@linux.dev> | 2025-02-28 14:38:47 -0500 |
|---|---|---|
| committer | Kent Overstreet <kent.overstreet@linux.dev> | 2025-03-14 21:02:16 -0400 |
| commit | b31c070407edda710ad087d143353ddd0f2c9499 (patch) | |
| tree | 759d3274e971a72c5bdcbe73416aeac08ccb6b6b /fs/bcachefs/btree_node_scan.c | |
| parent | bcachefs: bch2_account_io_completion() (diff) | |
| download | linux-b31c070407edda710ad087d143353ddd0f2c9499.tar.gz linux-b31c070407edda710ad087d143353ddd0f2c9499.zip | |
bcachefs: Finish bch2_account_io_completion() conversions
More prep work for automatically kicking devices out after too many IO
errors.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/btree_node_scan.c')
| -rw-r--r-- | fs/bcachefs/btree_node_scan.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/fs/bcachefs/btree_node_scan.c b/fs/bcachefs/btree_node_scan.c index a7f06deee13c..fb73ec77c099 100644 --- a/fs/bcachefs/btree_node_scan.c +++ b/fs/bcachefs/btree_node_scan.c @@ -166,11 +166,17 @@ static void try_read_btree_node(struct find_btree_nodes *f, struct bch_dev *ca, bio->bi_iter.bi_sector = offset; bch2_bio_map(bio, bn, PAGE_SIZE); + u64 submit_time = local_clock(); submit_bio_wait(bio); - if (bch2_dev_io_err_on(bio->bi_status, ca, BCH_MEMBER_ERROR_read, - "IO error in try_read_btree_node() at %llu: %s", - offset, bch2_blk_status_to_str(bio->bi_status))) + + bch2_account_io_completion(ca, BCH_MEMBER_ERROR_read, submit_time, !bio->bi_status); + + if (bio->bi_status) { + bch_err_dev_ratelimited(ca, + "IO error in try_read_btree_node() at %llu: %s", + offset, bch2_blk_status_to_str(bio->bi_status)); return; + } if (le64_to_cpu(bn->magic) != bset_magic(c)) return; |
