summaryrefslogtreecommitdiff
path: root/fs/bcachefs/str_hash.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2020-01-27 17:47:07 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:08:34 -0400
commit4dba7c301782de9cba75b7895a5068c0bf07a551 (patch)
tree0e6f10b3a443015171ad160e58b83f54144d2adf /fs/bcachefs/str_hash.h
parentab05de4ce4a1b806773e59b97a59bcfabba57d8d (diff)
bcachefs: Fix an in iterator leak
This should fix a transaction iterator overflow bug during fsck. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/str_hash.h')
-rw-r--r--fs/bcachefs/str_hash.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/bcachefs/str_hash.h b/fs/bcachefs/str_hash.h
index 35f4232d0755..cf6ecd963a7b 100644
--- a/fs/bcachefs/str_hash.h
+++ b/fs/bcachefs/str_hash.h
@@ -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 */