Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

bcachefs: Don't log errors if BCH_WRITE_ALLOC_NOWAIT

Previously, we added logging in the write path to ensure that any
unexpected errors getting reported to userspace have a log message; but
BCH_WRITE_ALLOC_NOWAIT is a special case, it's used for promotes where
errors are expected and not reported out to userspace - so we need to
silence those.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>

+5 -4
+5 -4
fs/bcachefs/io_write.c
··· 1447 1447 op->flags |= BCH_WRITE_DONE; 1448 1448 1449 1449 if (ret < 0) { 1450 - bch_err_inum_offset_ratelimited(c, 1451 - op->pos.inode, 1452 - op->pos.offset << 9, 1453 - "%s(): error: %s", __func__, bch2_err_str(ret)); 1450 + if (!(op->flags & BCH_WRITE_ALLOC_NOWAIT)) 1451 + bch_err_inum_offset_ratelimited(c, 1452 + op->pos.inode, 1453 + op->pos.offset << 9, 1454 + "%s(): error: %s", __func__, bch2_err_str(ret)); 1454 1455 op->error = ret; 1455 1456 break; 1456 1457 }