Commit 61a66469 authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet
Browse files

bcachefs: Fix lock ordering under traverse_all()



traverse_all() traverses btree paths in sorted order, so it should never
see transaction restarts due to lock ordering violations. But some code
in __bch2_btree_path_upgrade(), while necessary when not running under
traverse_all(), was causing some confusing lock ordering violations -
disabling this code under traverse_all() will let us put in some more
assertions.

Signed-off-by: default avatarKent Overstreet <kent.overstreet@gmail.com>
parent a897ef68
Loading
Loading
Loading
Loading
+9 −8
Original line number Diff line number Diff line
@@ -473,6 +473,7 @@ bool __bch2_btree_path_upgrade(struct btree_trans *trans,
	 * before interior nodes - now that's handled by
	 * bch2_btree_path_traverse_all().
	 */
	if (!path->cached && !trans->in_traverse_all)
		trans_for_each_path(trans, linked)
			if (linked != path &&
			    linked->cached == path->cached &&