diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-25 23:29:37 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-11-02 04:11:08 +0300 |
commit | 94119eeb02d114aa1f78dcfaabdca50b9b626790 (patch) | |
tree | ff13ee14b7f0aee14a85fa3805ac38dd6cd35e97 /fs/bcachefs/super-io.c | |
parent | 5394fe9494011de19baff276ce02a2f00eef568a (diff) | |
download | linux-94119eeb02d114aa1f78dcfaabdca50b9b626790.tar.xz |
bcachefs: Add IO error counts to bch_member
We now track IO errors per device since filesystem creation.
IO error counts can be viewed in sysfs, or with the 'bcachefs
show-super' command.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/super-io.c')
-rw-r--r-- | fs/bcachefs/super-io.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/bcachefs/super-io.c b/fs/bcachefs/super-io.c index 332d41e1c0a3..64e861b87535 100644 --- a/fs/bcachefs/super-io.c +++ b/fs/bcachefs/super-io.c @@ -805,7 +805,12 @@ static void write_super_endio(struct bio *bio) /* XXX: return errors directly */ - if (bch2_dev_io_err_on(bio->bi_status, ca, "superblock write error: %s", + if (bch2_dev_io_err_on(bio->bi_status, ca, + bio_data_dir(bio) + ? BCH_MEMBER_ERROR_write + : BCH_MEMBER_ERROR_read, + "superblock %s error: %s", + bio_data_dir(bio) ? "write" : "read", bch2_blk_status_to_str(bio->bi_status))) ca->sb_write_error = 1; @@ -892,7 +897,7 @@ int bch2_write_super(struct bch_fs *c) SET_BCH_SB_BIG_ENDIAN(c->disk_sb.sb, CPU_BIG_ENDIAN); bch2_sb_counters_from_cpu(c); - bch_members_cpy_v2_v1(&c->disk_sb); + bch2_sb_members_cpy_v2_v1(&c->disk_sb); for_each_online_member(ca, c, i) bch2_sb_from_fs(c, ca); |