Skip to content

Commit 4ecad0d

Browse files
author
Kent Overstreet
committed
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>
1 parent e240c1b commit 4ecad0d

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

fs/bcachefs/io_write.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1447,10 +1447,11 @@ static void __bch2_write(struct bch_write_op *op)
14471447
op->flags |= BCH_WRITE_DONE;
14481448

14491449
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));
14541455
op->error = ret;
14551456
break;
14561457
}

0 commit comments

Comments
 (0)