bcachefs: ec_validate_checksums() -> bch2_dev_tryget()

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2024-04-30 20:42:50 -04:00
parent 8783856ab1
commit c387d84413
1 changed files with 12 additions and 10 deletions

View File

@ -633,8 +633,9 @@ static void ec_validate_checksums(struct bch_fs *c, struct ec_stripe_buf *buf)
struct bch_csum got = ec_block_checksum(buf, i, offset);
if (bch2_crc_cmp(want, got)) {
struct bch_dev *ca = bch2_dev_tryget(c, v->ptrs[i].dev);
if (ca) {
struct printbuf err = PRINTBUF;
struct bch_dev *ca = bch2_dev_bkey_exists(c, v->ptrs[i].dev);
prt_str(&err, "stripe ");
bch2_csum_err_msg(&err, v->csum_type, want, got);
@ -643,9 +644,10 @@ static void ec_validate_checksums(struct bch_fs *c, struct ec_stripe_buf *buf)
bch_err_ratelimited(ca, "%s", err.buf);
printbuf_exit(&err);
clear_bit(i, buf->valid);
bch2_io_error(ca, BCH_MEMBER_ERROR_checksum);
}
clear_bit(i, buf->valid);
break;
}