Skip to content

Commit 6c4897c

Browse files
author
Kent Overstreet
committed
bcachefs: Fix bch2_read_bio_to_text()
We can only pass negative error codes to bch2_err_str(); if it's a positive integer it's not an error and we trip an assert. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
1 parent 495ba89 commit 6c4897c

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

fs/bcachefs/io_read.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1491,7 +1491,12 @@ void bch2_read_bio_to_text(struct printbuf *out, struct bch_read_bio *rbio)
14911491
prt_printf(out, "have_ioref:\t%u\n", rbio->have_ioref);
14921492
prt_printf(out, "narrow_crcs:\t%u\n", rbio->narrow_crcs);
14931493
prt_printf(out, "context:\t%u\n", rbio->context);
1494-
prt_printf(out, "ret:\t%s\n", bch2_err_str(rbio->ret));
1494+
1495+
int ret = READ_ONCE(rbio->ret);
1496+
if (ret < 0)
1497+
prt_printf(out, "ret:\t%s\n", bch2_err_str(ret));
1498+
else
1499+
prt_printf(out, "ret:\t%i\n", ret);
14951500

14961501
prt_printf(out, "flags:\t");
14971502
bch2_prt_bitflags(out, bch2_read_bio_flags, rbio->flags);

0 commit comments

Comments
 (0)