mirror of
https://github.com/torvalds/linux.git
synced 2026-06-01 11:03:43 +02:00
bcachefs: Change a BUG_ON() to a fatal error
In the btree key cache code, failing to flush a dirty key is a serious error, but it doesn't need to be a BUG_ON(), we can stop the filesystem instead. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
d0022290b8
commit
d7b04163c2
|
|
@ -368,10 +368,11 @@ static int btree_key_cache_flush_pos(struct btree_trans *trans,
|
|||
if (ret == -EINTR)
|
||||
goto retry;
|
||||
|
||||
BUG_ON(ret && !bch2_journal_error(j));
|
||||
|
||||
if (ret)
|
||||
if (ret) {
|
||||
bch2_fs_fatal_err_on(!bch2_journal_error(j), c,
|
||||
"error flushing key cache: %i", ret);
|
||||
goto out;
|
||||
}
|
||||
|
||||
bch2_journal_pin_drop(j, &ck->journal);
|
||||
bch2_journal_preres_put(j, &ck->res);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user