diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2020-12-03 13:57:22 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:08:49 -0400 |
commit | 0fefe8d8ef74029e9f3676ef9613ef022ae6dbd6 (patch) | |
tree | f65e5694f8cf33268716425a2346ea268ad9ddec /fs/bcachefs/ec.c | |
parent | f299d57350b2450c522dc7780400ce811f4847ec (diff) | |
download | lwn-0fefe8d8ef74029e9f3676ef9613ef022ae6dbd6.tar.gz lwn-0fefe8d8ef74029e9f3676ef9613ef022ae6dbd6.zip |
bcachefs: Improve some IO error messages
it's useful to know whether an error was for a read or a write - this
also standardizes error messages a bit more.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/ec.c')
-rw-r--r-- | fs/bcachefs/ec.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/bcachefs/ec.c b/fs/bcachefs/ec.c index 42331f0e54e7..6c9259ee6742 100644 --- a/fs/bcachefs/ec.c +++ b/fs/bcachefs/ec.c @@ -264,7 +264,7 @@ static void ec_validate_checksums(struct bch_fs *c, struct ec_stripe_buf *buf) len << 9); if (memcmp(stripe_csum(v, i, j), &csum, csum_bytes)) { - __bcache_io_error(c, + bch_err_ratelimited(c, "checksum error while doing reconstruct read (%u:%u)", i, j); clear_bit(i, buf->valid); @@ -305,7 +305,7 @@ static int ec_do_recov(struct bch_fs *c, struct ec_stripe_buf *buf) unsigned bytes = buf->size << 9; if (ec_nr_failed(buf) > v->nr_redundant) { - __bcache_io_error(c, + bch_err_ratelimited(c, "error doing reconstruct read: unable to read enough blocks"); return -1; } @@ -326,7 +326,7 @@ static void ec_block_endio(struct bio *bio) struct bch_dev *ca = ec_bio->ca; struct closure *cl = bio->bi_private; - if (bch2_dev_io_err_on(bio->bi_status, ca, "erasure coding %s: %s", + if (bch2_dev_io_err_on(bio->bi_status, ca, "erasure coding %s error: %s", bio_data_dir(bio) ? "write" : "read", bch2_blk_status_to_str(bio->bi_status))) clear_bit(ec_bio->idx, ec_bio->buf->valid); @@ -420,7 +420,7 @@ int bch2_ec_read_extent(struct bch_fs *c, struct bch_read_bio *rbio) BTREE_ITER_SLOTS); k = bch2_btree_iter_peek_slot(iter); if (bkey_err(k) || k.k->type != KEY_TYPE_stripe) { - __bcache_io_error(c, + bch_err_ratelimited(c, "error doing reconstruct read: stripe not found"); kfree(buf); return bch2_trans_exit(&trans) ?: -EIO; @@ -462,7 +462,7 @@ int bch2_ec_read_extent(struct bch_fs *c, struct bch_read_bio *rbio) struct bch_dev *ca = bch_dev_bkey_exists(c, ptr->dev); if (ptr_stale(ca, ptr)) { - __bcache_io_error(c, + bch_err_ratelimited(c, "error doing reconstruct read: stale pointer"); clear_bit(i, buf->valid); continue; @@ -474,7 +474,7 @@ int bch2_ec_read_extent(struct bch_fs *c, struct bch_read_bio *rbio) closure_sync(&cl); if (ec_nr_failed(buf) > v->nr_redundant) { - __bcache_io_error(c, + bch_err_ratelimited(c, "error doing reconstruct read: unable to read enough blocks"); ret = -EIO; goto err; |