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

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: default avatarKent Overstreet <kent.overstreet@gmail.com>
parent 23dfb3a2
...@@ -3289,8 +3289,8 @@ u32 bch2_trans_begin(struct btree_trans *trans) ...@@ -3289,8 +3289,8 @@ u32 bch2_trans_begin(struct btree_trans *trans)
void bch2_trans_verify_not_restarted(struct btree_trans *trans, u32 restart_count) void bch2_trans_verify_not_restarted(struct btree_trans *trans, u32 restart_count)
{ {
bch2_trans_inconsistent_on(trans_was_restarted(trans, restart_count), trans, if (trans_was_restarted(trans, restart_count))
"trans->restart_count %u, should be %u, last restarted by %ps\n", panic("trans->restart_count %u, should be %u, last restarted by %pS\n",
trans->restart_count, restart_count, trans->restart_count, restart_count,
(void *) trans->last_restarted_ip); (void *) trans->last_restarted_ip);
} }
......
...@@ -290,7 +290,7 @@ static int fsck_inode_rm(struct btree_trans *trans, u64 inum, u32 snapshot) ...@@ -290,7 +290,7 @@ static int fsck_inode_rm(struct btree_trans *trans, u64 inum, u32 snapshot)
if (bch2_err_matches(ret, BCH_ERR_transaction_restart)) if (bch2_err_matches(ret, BCH_ERR_transaction_restart))
goto retry; goto retry;
return ret; return ret ?: -BCH_ERR_transaction_restart_nested;
} }
static int __remove_dirent(struct btree_trans *trans, struct bpos pos) static int __remove_dirent(struct btree_trans *trans, struct bpos pos)
...@@ -914,7 +914,7 @@ static int check_inode(struct btree_trans *trans, ...@@ -914,7 +914,7 @@ static int check_inode(struct btree_trans *trans,
bch2_fs_lazy_rw(c); bch2_fs_lazy_rw(c);
ret = fsck_inode_rm(trans, u.bi_inum, iter->pos.snapshot); 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", bch_err(c, "error in fsck: error while deleting inode: %s",
bch2_err_str(ret)); bch2_err_str(ret));
return ret; return ret;
......
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