Update bcachefs sources to 07bac0c685 bcachefs: fsck: Work around transaction restarts

This commit is contained in:
Kent Overstreet 2022-04-06 14:42:00 -04:00
parent 790ca9522a
commit 30306c5aa6
2 changed files with 17 additions and 3 deletions

View File

@ -1 +1 @@
e027cf9aa0e18b688d76cd6c2702491b8d06f48f 07bac0c685f553f66938053e9aa725dc8df0e3ee

View File

@ -1146,7 +1146,7 @@ static int check_extent(struct btree_trans *trans, struct btree_iter *iter,
struct inode_walker_entry *i; struct inode_walker_entry *i;
struct printbuf buf = PRINTBUF; struct printbuf buf = PRINTBUF;
int ret = 0; int ret = 0;
peek:
k = bch2_btree_iter_peek(iter); k = bch2_btree_iter_peek(iter);
if (!k.k) if (!k.k)
goto out; goto out;
@ -1173,6 +1173,15 @@ static int check_extent(struct btree_trans *trans, struct btree_iter *iter,
if (ret) if (ret)
goto err; goto err;
} }
if (!iter->path->should_be_locked) {
/*
* hack: check_i_sectors may have handled a transaction restart,
* it shouldn't be but we need to fix the new i_sectors check
* code and delete the old bch2_count_inode_sectors() first
*/
goto peek;
}
#if 0 #if 0
if (bkey_cmp(prev.k->k.p, bkey_start_pos(k.k)) > 0) { if (bkey_cmp(prev.k->k.p, bkey_start_pos(k.k)) > 0) {
char buf1[200]; char buf1[200];
@ -1464,7 +1473,7 @@ static int check_dirent(struct btree_trans *trans, struct btree_iter *iter,
struct inode_walker_entry *i; struct inode_walker_entry *i;
struct printbuf buf = PRINTBUF; struct printbuf buf = PRINTBUF;
int ret = 0; int ret = 0;
peek:
k = bch2_btree_iter_peek(iter); k = bch2_btree_iter_peek(iter);
if (!k.k) if (!k.k)
goto out; goto out;
@ -1492,6 +1501,11 @@ static int check_dirent(struct btree_trans *trans, struct btree_iter *iter,
goto err; goto err;
} }
if (!iter->path->should_be_locked) {
/* hack: see check_extent() */
goto peek;
}
ret = __walk_inode(trans, dir, k.k->p); ret = __walk_inode(trans, dir, k.k->p);
if (ret < 0) if (ret < 0)
goto err; goto err;