Thread (10 messages) 10 messages, 6 authors, 2021-08-17

Re: 5.14-0-rc5, splat in block_group_cache_tree_search while __btrfs_unlink_inode

From: Peter Zijlstra <peterz@infradead.org>
Date: 2021-08-17 08:47:02

On Mon, Aug 16, 2021 at 10:43:54PM +0200, David Sterba wrote:
On Mon, Aug 16, 2021 at 05:11:55PM +0200, Peter Zijlstra wrote:
quoted
Something a little like the *completely* untested below....

Then I imagine someone could do something like:

struct my_tree_node {
	...
	spinlock_t lock;
Is this meant to work only for spinlocks or does it work for rwsem too?
I guess with lockdep it does not matter but we use rwsem for tree locks.
Anything with a ->dep_map member works; courtesy of macros :-) That very
much includes rwsems.
quoted
@@ -4920,6 +4962,15 @@ static int __lock_acquire(struct lockdep_map *lock, unsigned int subclass,
 
 	class_idx = class - lock_classes;
 
+	if (nest_lock) {
+		if (!__lock_is_held(nest_lock, -1)) {
+			print_lock_nested_lock_not_held(curr, hlock, ip);
+			return 0;
+		}
+		if (nest_lock->type == LD_LOCK_NEST_FUNC)
That's probably nest_lock->lock_type, does not compile otherwise.
Yes, sorry, typing so hard :-)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help