From: Kent Overstreet Date: Mon, 19 Sep 2022 18:14:01 +0000 (-0400) Subject: bcachefs: Add a debug assert X-Git-Tag: v6.7-rc1~201^2~775 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=845cffed0d343ecea9f6ff3883cac9a6872d9920;p=thirdparty%2Fkernel%2Flinux.git bcachefs: Add a debug assert Chasing down a strange locking bug. Signed-off-by: Kent Overstreet --- diff --git a/fs/bcachefs/btree_iter.c b/fs/bcachefs/btree_iter.c index 1650ba87ef03c..df9949cef9079 100644 --- a/fs/bcachefs/btree_iter.c +++ b/fs/bcachefs/btree_iter.c @@ -1110,6 +1110,9 @@ static int btree_path_traverse_one(struct btree_trans *trans, path->level = btree_path_up_until_good_node(trans, path, 0); + EBUG_ON(btree_path_node(path, path->level) && + !btree_node_locked(path, path->level)); + /* * Note: path->nodes[path->level] may be temporarily NULL here - that * would indicate to other code that we got to the end of the btree,