mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-28 13:22:57 +00:00
bcachefs: Add bch2_blk_status_to_str()
We define our own BLK_STS_REMOVED, so we need our own to_str helper too. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
a2b5313a39
commit
63b214e75b
6 changed files with 17 additions and 7 deletions
|
@ -1149,7 +1149,7 @@ static void btree_node_read_work(struct work_struct *work)
|
|||
}
|
||||
start:
|
||||
bch2_dev_io_err_on(bio->bi_status, ca, "btree read: %s",
|
||||
blk_status_to_str(bio->bi_status));
|
||||
bch2_blk_status_to_str(bio->bi_status));
|
||||
if (rb->have_ioref)
|
||||
percpu_ref_put(&ca->io_ref);
|
||||
rb->have_ioref = false;
|
||||
|
@ -1435,7 +1435,7 @@ static void btree_node_write_endio(struct bio *bio)
|
|||
bch2_latency_acct(ca, wbio->submit_time, WRITE);
|
||||
|
||||
if (bch2_dev_io_err_on(bio->bi_status, ca, "btree write: %s",
|
||||
blk_status_to_str(bio->bi_status)) ||
|
||||
bch2_blk_status_to_str(bio->bi_status)) ||
|
||||
bch2_meta_write_fault("btree")) {
|
||||
spin_lock_irqsave(&c->btree_write_error_lock, flags);
|
||||
bch2_dev_list_add_dev(&orig->failed, wbio->dev);
|
||||
|
|
|
@ -328,7 +328,7 @@ static void ec_block_endio(struct bio *bio)
|
|||
|
||||
if (bch2_dev_io_err_on(bio->bi_status, ca, "erasure coding %s: %s",
|
||||
bio_data_dir(bio) ? "write" : "read",
|
||||
blk_status_to_str(bio->bi_status)))
|
||||
bch2_blk_status_to_str(bio->bi_status)))
|
||||
clear_bit(ec_bio->idx, ec_bio->buf->valid);
|
||||
|
||||
bio_put(&ec_bio->bio);
|
||||
|
|
|
@ -34,6 +34,13 @@
|
|||
#include <linux/random.h>
|
||||
#include <linux/sched/mm.h>
|
||||
|
||||
const char *bch2_blk_status_to_str(blk_status_t status)
|
||||
{
|
||||
if (status == BLK_STS_REMOVED)
|
||||
return "device removed";
|
||||
return blk_status_to_str(status);
|
||||
}
|
||||
|
||||
#ifndef CONFIG_BCACHEFS_NO_LATENCY_ACCT
|
||||
|
||||
static bool bch2_target_congested(struct bch_fs *c, u16 target)
|
||||
|
@ -626,7 +633,7 @@ static void bch2_write_endio(struct bio *bio)
|
|||
struct bch_dev *ca = bch_dev_bkey_exists(c, wbio->dev);
|
||||
|
||||
if (bch2_dev_io_err_on(bio->bi_status, ca, "data write: %s",
|
||||
blk_status_to_str(bio->bi_status)))
|
||||
bch2_blk_status_to_str(bio->bi_status)))
|
||||
set_bit(wbio->dev, op->failed.d);
|
||||
|
||||
if (wbio->have_ioref) {
|
||||
|
@ -1921,7 +1928,7 @@ static void bch2_read_endio(struct bio *bio)
|
|||
rbio->bio.bi_end_io = rbio->end_io;
|
||||
|
||||
if (bch2_dev_io_err_on(bio->bi_status, ca, "data read; %s",
|
||||
blk_status_to_str(bio->bi_status))) {
|
||||
bch2_blk_status_to_str(bio->bi_status))) {
|
||||
bch2_rbio_error(rbio, READ_RETRY_AVOID, bio->bi_status);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -26,6 +26,8 @@ void bch2_submit_wbio_replicas(struct bch_write_bio *, struct bch_fs *,
|
|||
|
||||
#define BLK_STS_REMOVED ((__force blk_status_t)128)
|
||||
|
||||
const char *bch2_blk_status_to_str(blk_status_t);
|
||||
|
||||
enum bch_write_flags {
|
||||
BCH_WRITE_ALLOC_NOWAIT = (1 << 0),
|
||||
BCH_WRITE_CACHED = (1 << 1),
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
#include "buckets.h"
|
||||
#include "checksum.h"
|
||||
#include "error.h"
|
||||
#include "io.h"
|
||||
#include "journal.h"
|
||||
#include "journal_io.h"
|
||||
#include "journal_reclaim.h"
|
||||
|
@ -961,7 +962,7 @@ static void journal_write_endio(struct bio *bio)
|
|||
struct journal *j = &ca->fs->journal;
|
||||
|
||||
if (bch2_dev_io_err_on(bio->bi_status, ca, "journal write: %s",
|
||||
blk_status_to_str(bio->bi_status)) ||
|
||||
bch2_blk_status_to_str(bio->bi_status)) ||
|
||||
bch2_meta_write_fault("journal")) {
|
||||
struct journal_buf *w = journal_prev_buf(j);
|
||||
unsigned long flags;
|
||||
|
|
|
@ -641,7 +641,7 @@ static void write_super_endio(struct bio *bio)
|
|||
/* XXX: return errors directly */
|
||||
|
||||
if (bch2_dev_io_err_on(bio->bi_status, ca, "superblock write: %s",
|
||||
blk_status_to_str(bio->bi_status)))
|
||||
bch2_blk_status_to_str(bio->bi_status)))
|
||||
ca->sb_write_error = 1;
|
||||
|
||||
closure_put(&ca->fs->sb_write);
|
||||
|
|
Loading…
Reference in a new issue