mirror of
https://github.com/torvalds/linux.git
synced 2026-05-25 15:41:52 +02:00
bcachefs: errcode cleanup: journal errors
Instead of throwing standard error codes, we should be throwing dedicated private error codes, this greatly improves debugability. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
525be09e63
commit
6534a404d4
|
|
@ -241,6 +241,8 @@
|
|||
x(BCH_ERR_invalid_sb, invalid_sb_downgrade) \
|
||||
x(BCH_ERR_invalid, invalid_bkey) \
|
||||
x(BCH_ERR_operation_blocked, nocow_lock_blocked) \
|
||||
x(EIO, journal_shutdown) \
|
||||
x(EIO, journal_flush_err) \
|
||||
x(EIO, btree_node_read_err) \
|
||||
x(BCH_ERR_btree_node_read_err, btree_node_read_err_cached) \
|
||||
x(EIO, sb_not_downgraded) \
|
||||
|
|
|
|||
|
|
@ -673,7 +673,7 @@ void bch2_journal_entry_res_resize(struct journal *j,
|
|||
* @seq: seq to flush
|
||||
* @parent: closure object to wait with
|
||||
* Returns: 1 if @seq has already been flushed, 0 if @seq is being flushed,
|
||||
* -EIO if @seq will never be flushed
|
||||
* -BCH_ERR_journal_flush_err if @seq will never be flushed
|
||||
*
|
||||
* Like bch2_journal_wait_on_seq, except that it triggers a write immediately if
|
||||
* necessary
|
||||
|
|
@ -696,7 +696,7 @@ int bch2_journal_flush_seq_async(struct journal *j, u64 seq,
|
|||
|
||||
/* Recheck under lock: */
|
||||
if (j->err_seq && seq >= j->err_seq) {
|
||||
ret = -EIO;
|
||||
ret = -BCH_ERR_journal_flush_err;
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -412,7 +412,7 @@ void bch2_journal_halt(struct journal *);
|
|||
static inline int bch2_journal_error(struct journal *j)
|
||||
{
|
||||
return j->reservations.cur_entry_offset == JOURNAL_ENTRY_ERROR_VAL
|
||||
? -EIO : 0;
|
||||
? -BCH_ERR_journal_shutdown : 0;
|
||||
}
|
||||
|
||||
struct bch_dev;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user