summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2024-10-14 22:40:20 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2024-10-18 00:49:47 -0400
commit94bdeec8f5303a8e445c9a7b9b2b2d69a29d7f38 (patch)
tree5f6146815a819563585dd7c0666c3ae8704d9fde /fs
parent74ec2f302402c4cfd172f7254ae0e5b851e31b0a (diff)
bcachefs: fix bch2_hash_delete() error path
we were exiting an iterator that hadn't been initialized Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs')
-rw-r--r--fs/bcachefs/str_hash.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/bcachefs/str_hash.h b/fs/bcachefs/str_hash.h
index 215eed4cce6d..cc2084e9f1cc 100644
--- a/fs/bcachefs/str_hash.h
+++ b/fs/bcachefs/str_hash.h
@@ -363,8 +363,11 @@ int bch2_hash_delete(struct btree_trans *trans,
struct btree_iter iter;
struct bkey_s_c k = bch2_hash_lookup(trans, &iter, desc, info, inum, key,
BTREE_ITER_intent);
- int ret = bkey_err(k) ?:
- bch2_hash_delete_at(trans, desc, info, &iter, 0);
+ int ret = bkey_err(k);
+ if (ret)
+ return ret;
+
+ ret = bch2_hash_delete_at(trans, desc, info, &iter, 0);
bch2_trans_iter_exit(trans, &iter);
return ret;
}