diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2022-08-18 13:03:43 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2022-08-18 13:03:43 -0400 |
commit | c4ddc63aecf1e4c820532b8e6ab47e98f74d3d7d (patch) | |
tree | 0c239d2b2c8689fe7497a0f1546b651c644f5cb6 /libbcachefs/fsck.c | |
parent | dded444b20dd3f47393937315b8217535ff3c51d (diff) |
Update bcachefs sources to 3421116a6c bcachefs: bch2_btree_delete_range_trans() now returns -BCH_ERR_transaction_restart_nested
Diffstat (limited to 'libbcachefs/fsck.c')
-rw-r--r-- | libbcachefs/fsck.c | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/libbcachefs/fsck.c b/libbcachefs/fsck.c index 1a841146..ff10f09e 100644 --- a/libbcachefs/fsck.c +++ b/libbcachefs/fsck.c @@ -19,6 +19,10 @@ #define QSTR(n) { { { .len = strlen(n) } }, .name = n } +/* + * XXX: this is handling transaction restarts without returning + * -BCH_ERR_transaction_restart_nested, this is not how we do things anymore: + */ static s64 bch2_count_inode_sectors(struct btree_trans *trans, u64 inum, u32 snapshot) { @@ -239,18 +243,20 @@ static int fsck_inode_rm(struct btree_trans *trans, u64 inum, u32 snapshot) struct bkey_s_c k; int ret; - ret = bch2_btree_delete_range_trans(trans, BTREE_ID_extents, - SPOS(inum, 0, snapshot), - SPOS(inum, U64_MAX, snapshot), - 0, NULL) ?: - bch2_btree_delete_range_trans(trans, BTREE_ID_dirents, - SPOS(inum, 0, snapshot), - SPOS(inum, U64_MAX, snapshot), - 0, NULL) ?: - bch2_btree_delete_range_trans(trans, BTREE_ID_xattrs, - SPOS(inum, 0, snapshot), - SPOS(inum, U64_MAX, snapshot), - 0, NULL); + do { + ret = bch2_btree_delete_range_trans(trans, BTREE_ID_extents, + SPOS(inum, 0, snapshot), + SPOS(inum, U64_MAX, snapshot), + 0, NULL) ?: + bch2_btree_delete_range_trans(trans, BTREE_ID_dirents, + SPOS(inum, 0, snapshot), + SPOS(inum, U64_MAX, snapshot), + 0, NULL) ?: + bch2_btree_delete_range_trans(trans, BTREE_ID_xattrs, + SPOS(inum, 0, snapshot), + SPOS(inum, U64_MAX, snapshot), + 0, NULL); + } while (ret == -BCH_ERR_transaction_restart_nested); if (ret) goto err; retry: |