Commit 4dba7c30 authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: Fix an in iterator leak

This should fix a transaction iterator overflow bug during fsck.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent ab05de4c
......@@ -319,13 +319,16 @@ int bch2_hash_delete(struct btree_trans *trans,
u64 inode, const void *key)
{
struct btree_iter *iter;
int ret;
iter = bch2_hash_lookup(trans, desc, info, inode, key,
BTREE_ITER_INTENT);
if (IS_ERR(iter))
return PTR_ERR(iter);
return bch2_hash_delete_at(trans, desc, info, iter);
ret = bch2_hash_delete_at(trans, desc, info, iter);
bch2_trans_iter_put(trans, iter);
return ret;
}
#endif /* _BCACHEFS_STR_HASH_H */
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