Skip to content

Commit a064596

Browse files
author
Kent Overstreet
committed
bcachefs: Silence extent_poisoned error messages
extent poisoning is partly so that we don't keep spewing the dmesg log when we've got unreadable data - we don't want to print these. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
1 parent 8692c7d commit a064596

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

fs/bcachefs/errcode.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@
287287
x(EIO, mark_stripe) \
288288
x(EIO, stripe_reconstruct) \
289289
x(EIO, key_type_error) \
290-
x(EIO, extent_poisened) \
290+
x(EIO, extent_poisoned) \
291291
x(EIO, missing_indirect_extent) \
292292
x(EIO, invalidate_stripe_to_dev) \
293293
x(EIO, no_encryption_key) \

fs/bcachefs/extents.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ int bch2_bkey_pick_read_device(struct bch_fs *c, struct bkey_s_c k,
139139
struct bkey_ptrs_c ptrs = bch2_bkey_ptrs_c(k);
140140

141141
if (bch2_bkey_extent_ptrs_flags(ptrs) & BIT_ULL(BCH_EXTENT_FLAG_poisoned))
142-
return -BCH_ERR_extent_poisened;
142+
return -BCH_ERR_extent_poisoned;
143143

144144
rcu_read_lock();
145145
const union bch_extent_entry *entry;

fs/bcachefs/io_read.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1349,14 +1349,16 @@ int __bch2_read(struct btree_trans *trans, struct bch_read_bio *rbio,
13491349

13501350
bch2_trans_iter_exit(trans, &iter);
13511351

1352-
if (ret) {
1353-
struct printbuf buf = PRINTBUF;
1354-
lockrestart_do(trans,
1355-
bch2_inum_offset_err_msg_trans(trans, &buf, inum,
1356-
bvec_iter.bi_sector << 9));
1357-
prt_printf(&buf, "read error: %s", bch2_err_str(ret));
1358-
bch_err_ratelimited(c, "%s", buf.buf);
1359-
printbuf_exit(&buf);
1352+
if (unlikely(ret)) {
1353+
if (ret != -BCH_ERR_extent_poisoned) {
1354+
struct printbuf buf = PRINTBUF;
1355+
lockrestart_do(trans,
1356+
bch2_inum_offset_err_msg_trans(trans, &buf, inum,
1357+
bvec_iter.bi_sector << 9));
1358+
prt_printf(&buf, "data read error: %s", bch2_err_str(ret));
1359+
bch_err_ratelimited(c, "%s", buf.buf);
1360+
printbuf_exit(&buf);
1361+
}
13601362

13611363
rbio->bio.bi_status = BLK_STS_IOERR;
13621364
rbio->ret = ret;

0 commit comments

Comments
 (0)