Skip to content

Commit

Permalink
bcachefs: Silence errors after emergency shutdown
Browse files Browse the repository at this point in the history
We don't care about errors from asynchronous ops that were because we
did an emergency shutdown; silence them.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
  • Loading branch information
Kent Overstreet committed Mar 30, 2025
1 parent 458e2ef commit f548db4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 5 additions & 2 deletions fs/bcachefs/btree_update_interior.c
Original file line number Diff line number Diff line change
Expand Up @@ -1268,7 +1268,8 @@ bch2_btree_update_start(struct btree_trans *trans, struct btree_path *path,
bch2_btree_update_free(as, trans);
if (!bch2_err_matches(ret, ENOSPC) &&
!bch2_err_matches(ret, EROFS) &&
ret != -BCH_ERR_journal_reclaim_would_deadlock)
ret != -BCH_ERR_journal_reclaim_would_deadlock &&
ret != -BCH_ERR_journal_shutdown)
bch_err_fn_ratelimited(c, ret);
return ERR_PTR(ret);
}
Expand Down Expand Up @@ -2302,7 +2303,9 @@ static void async_btree_node_rewrite_work(struct work_struct *work)

int ret = bch2_trans_do(c, bch2_btree_node_rewrite_key(trans,
a->btree_id, a->level, a->key.k, 0));
if (ret != -ENOENT)
if (ret != -ENOENT &&
!bch2_err_matches(ret, EROFS) &&
ret != -BCH_ERR_journal_shutdown)
bch_err_fn_ratelimited(c, ret);

spin_lock(&c->btree_node_rewrites_lock);
Expand Down
3 changes: 2 additions & 1 deletion fs/bcachefs/journal_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -1623,7 +1623,8 @@ static CLOSURE_CALLBACK(journal_write_done)
: j->noflush_write_time, j->write_start_time);

if (!w->devs_written.nr) {
bch_err(c, "unable to write journal to sufficient devices");
if (!bch2_journal_error(j))
bch_err(c, "unable to write journal to sufficient devices");
err = -BCH_ERR_journal_write_err;
} else {
bch2_devlist_to_replicas(&replicas.e, BCH_DATA_journal,
Expand Down

0 comments on commit f548db4

Please sign in to comment.