Commit b74b147d authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: Log message improvements

Change the error messages in bch2_inconsistent_error() and
bch2_fatal_error() so we can distinguish them.

Also, prefer bch2_fs_fatal_error() (which also logs an error message) to
bch2_fatal_error(), and change a call to bch2_inconsistent_error() to
bch2_fatal_error() when we can't continue.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@gmail.com>
parent 54460a62
...@@ -663,9 +663,8 @@ static inline int do_bch2_trans_commit(struct btree_trans *trans, ...@@ -663,9 +663,8 @@ static inline int do_bch2_trans_commit(struct btree_trans *trans,
char buf[200]; char buf[200];
bch2_bkey_val_to_text(&PBUF(buf), c, bkey_i_to_s_c(i->k)); bch2_bkey_val_to_text(&PBUF(buf), c, bkey_i_to_s_c(i->k));
bch_err(c, "invalid bkey %s on insert from %s -> %ps: %s\n", bch2_fs_fatal_error(c, "invalid bkey %s on insert from %s -> %ps: %s\n",
buf, trans->fn, (void *) i->ip_allocated, invalid); buf, trans->fn, (void *) i->ip_allocated, invalid);
bch2_fatal_error(c);
return -EINVAL; return -EINVAL;
} }
btree_insert_entry_checks(trans, i); btree_insert_entry_checks(trans, i);
......
...@@ -15,7 +15,7 @@ bool bch2_inconsistent_error(struct bch_fs *c) ...@@ -15,7 +15,7 @@ bool bch2_inconsistent_error(struct bch_fs *c)
return false; return false;
case BCH_ON_ERROR_ro: case BCH_ON_ERROR_ro:
if (bch2_fs_emergency_read_only(c)) if (bch2_fs_emergency_read_only(c))
bch_err(c, "emergency read only"); bch_err(c, "inconsistency detected - emergency read only");
return true; return true;
case BCH_ON_ERROR_panic: case BCH_ON_ERROR_panic:
panic(bch2_fmt(c, "panic after error")); panic(bch2_fmt(c, "panic after error"));
...@@ -35,7 +35,7 @@ void bch2_topology_error(struct bch_fs *c) ...@@ -35,7 +35,7 @@ void bch2_topology_error(struct bch_fs *c)
void bch2_fatal_error(struct bch_fs *c) void bch2_fatal_error(struct bch_fs *c)
{ {
if (bch2_fs_emergency_read_only(c)) if (bch2_fs_emergency_read_only(c))
bch_err(c, "emergency read only"); bch_err(c, "fatal error - emergency read only");
} }
void bch2_io_error_work(struct work_struct *work) void bch2_io_error_work(struct work_struct *work)
......
...@@ -1672,6 +1672,6 @@ void bch2_journal_write(struct closure *cl) ...@@ -1672,6 +1672,6 @@ void bch2_journal_write(struct closure *cl)
continue_at(cl, journal_write_done, c->io_complete_wq); continue_at(cl, journal_write_done, c->io_complete_wq);
return; return;
err: err:
bch2_inconsistent_error(c); bch2_fatal_error(c);
continue_at(cl, journal_write_done, c->io_complete_wq); continue_at(cl, journal_write_done, c->io_complete_wq);
} }
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