]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
bcachefs: Fix remove_dirent()
authorKent Overstreet <kent.overstreet@linux.dev>
Mon, 1 Apr 2024 04:00:32 +0000 (00:00 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Mon, 1 Apr 2024 04:52:32 +0000 (00:52 -0400)
We were missing an iter_traverse().

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/fsck.c

index aca6fae409cdf27bd09dc8a4a1837c93b4aa6452..0a47b0a473d8d3404ca6313e44afe279daf12a45 100644 (file)
@@ -158,9 +158,10 @@ static int __remove_dirent(struct btree_trans *trans, struct bpos pos)
 
        bch2_trans_iter_init(trans, &iter, BTREE_ID_dirents, pos, BTREE_ITER_INTENT);
 
-       ret = bch2_hash_delete_at(trans, bch2_dirent_hash_desc,
-                                 &dir_hash_info, &iter,
-                                 BTREE_UPDATE_INTERNAL_SNAPSHOT_NODE);
+       ret =   bch2_btree_iter_traverse(&iter) ?:
+               bch2_hash_delete_at(trans, bch2_dirent_hash_desc,
+                                   &dir_hash_info, &iter,
+                                   BTREE_UPDATE_INTERNAL_SNAPSHOT_NODE);
        bch2_trans_iter_exit(trans, &iter);
 err:
        bch_err_fn(c, ret);