summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/io_write.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2025-02-28 14:38:47 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2025-03-14 21:02:16 -0400
commitb31c070407edda710ad087d143353ddd0f2c9499 (patch)
tree759d3274e971a72c5bdcbe73416aeac08ccb6b6b /fs/bcachefs/io_write.c
parentbcachefs: bch2_account_io_completion() (diff)
downloadlinux-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/io_write.c')
-rw-r--r--fs/bcachefs/io_write.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/fs/bcachefs/io_write.c b/fs/bcachefs/io_write.c
index 738bdbfbdb14..dbfcb28f003d 100644
--- a/fs/bcachefs/io_write.c
+++ b/fs/bcachefs/io_write.c
@@ -716,11 +716,15 @@ static void bch2_write_endio(struct bio *bio)
? bch2_dev_have_ref(c, wbio->dev)
: NULL;
- if (bch2_dev_inum_io_err_on(bio->bi_status, ca, BCH_MEMBER_ERROR_write,
+ bch2_account_io_completion(ca, BCH_MEMBER_ERROR_write,
+ wbio->submit_time, !bio->bi_status);
+
+ if (bio->bi_status) {
+ bch_err_inum_offset_ratelimited(ca,
op->pos.inode,
wbio->inode_offset << 9,
"data write error: %s",
- bch2_blk_status_to_str(bio->bi_status))) {
+ bch2_blk_status_to_str(bio->bi_status));
set_bit(wbio->dev, op->failed.d);
op->flags |= BCH_WRITE_io_error;
}
@@ -732,10 +736,8 @@ static void bch2_write_endio(struct bio *bio)
set_bit(wbio->dev, op->devs_need_flush->d);
}
- if (wbio->have_ioref) {
- bch2_latency_acct(ca, wbio->submit_time, WRITE);
+ if (wbio->have_ioref)
percpu_ref_put(&ca->io_ref);
- }
if (wbio->bounce)
bch2_bio_free_pages_pool(c, bio);