Commit 4ecad0da authored by Kent Overstreet's avatar Kent Overstreet

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: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent e240c1b3
...@@ -1447,10 +1447,11 @@ static void __bch2_write(struct bch_write_op *op) ...@@ -1447,10 +1447,11 @@ static void __bch2_write(struct bch_write_op *op)
op->flags |= BCH_WRITE_DONE; op->flags |= BCH_WRITE_DONE;
if (ret < 0) { if (ret < 0) {
bch_err_inum_offset_ratelimited(c, if (!(op->flags & BCH_WRITE_ALLOC_NOWAIT))
op->pos.inode, bch_err_inum_offset_ratelimited(c,
op->pos.offset << 9, op->pos.inode,
"%s(): error: %s", __func__, bch2_err_str(ret)); op->pos.offset << 9,
"%s(): error: %s", __func__, bch2_err_str(ret));
op->error = ret; op->error = ret;
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment