summaryrefslogtreecommitdiff
path: root/fs/bcachefs/btree_update_interior.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2021-06-14 18:16:10 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:09:06 -0400
commit8c3f6da9fc526e7ba0f6449efa1040084406e9ba (patch)
tree6106b0097c188e1acb746de16468c28f095aad40 /fs/bcachefs/btree_update_interior.c
parentb89726ab86aab15ea8526fb365da6a0f5d474241 (diff)
downloadlwn-8c3f6da9fc526e7ba0f6449efa1040084406e9ba.tar.gz
lwn-8c3f6da9fc526e7ba0f6449efa1040084406e9ba.zip
bcachefs: Improve iter->should_be_locked
Adding iter->should_be_locked introduced a regression where it ended up not being set on the iterator passed to bch2_btree_update_start(), which is definitely not what we want. This patch requires it to be set when calling bch2_trans_update(), and adds various fixups to make that happen. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/btree_update_interior.c')
-rw-r--r--fs/bcachefs/btree_update_interior.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/bcachefs/btree_update_interior.c b/fs/bcachefs/btree_update_interior.c
index bb01b036c7a2..e35e842efe81 100644
--- a/fs/bcachefs/btree_update_interior.c
+++ b/fs/bcachefs/btree_update_interior.c
@@ -937,6 +937,8 @@ bch2_btree_update_start(struct btree_iter *iter, unsigned level,
int journal_flags = 0;
int ret = 0;
+ BUG_ON(!iter->should_be_locked);
+
if (flags & BTREE_INSERT_JOURNAL_RESERVED)
journal_flags |= JOURNAL_RES_GET_RESERVED;