bcachefs: Minor transaction restart handling fix
- fsck_inode_rm() wasn't returning BCH_ERR_transaction_restart_nested - change bch2_trans_verify_not_restarted() to call panic() - we don't want these errors to be missed Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
This commit is contained in:
parent
23dfb3a2f7
commit
efd0d03816
@ -3289,10 +3289,10 @@ u32 bch2_trans_begin(struct btree_trans *trans)
|
||||
|
||||
void bch2_trans_verify_not_restarted(struct btree_trans *trans, u32 restart_count)
|
||||
{
|
||||
bch2_trans_inconsistent_on(trans_was_restarted(trans, restart_count), trans,
|
||||
"trans->restart_count %u, should be %u, last restarted by %ps\n",
|
||||
trans->restart_count, restart_count,
|
||||
(void *) trans->last_restarted_ip);
|
||||
if (trans_was_restarted(trans, restart_count))
|
||||
panic("trans->restart_count %u, should be %u, last restarted by %pS\n",
|
||||
trans->restart_count, restart_count,
|
||||
(void *) trans->last_restarted_ip);
|
||||
}
|
||||
|
||||
static void bch2_trans_alloc_paths(struct btree_trans *trans, struct bch_fs *c)
|
||||
|
@ -290,7 +290,7 @@ err:
|
||||
if (bch2_err_matches(ret, BCH_ERR_transaction_restart))
|
||||
goto retry;
|
||||
|
||||
return ret;
|
||||
return ret ?: -BCH_ERR_transaction_restart_nested;
|
||||
}
|
||||
|
||||
static int __remove_dirent(struct btree_trans *trans, struct bpos pos)
|
||||
@ -914,7 +914,7 @@ static int check_inode(struct btree_trans *trans,
|
||||
bch2_fs_lazy_rw(c);
|
||||
|
||||
ret = fsck_inode_rm(trans, u.bi_inum, iter->pos.snapshot);
|
||||
if (ret)
|
||||
if (ret && !bch2_err_matches(ret, BCH_ERR_transaction_restart))
|
||||
bch_err(c, "error in fsck: error while deleting inode: %s",
|
||||
bch2_err_str(ret));
|
||||
return ret;
|
||||
|
Loading…
Reference in New Issue
Block a user