> Lockdep works in the special-case example of VFS. It still can't be
> made to handle general tree-usage patterns.
I don't think that's true. Take a look at Documentation/lockdep-design.txt. The
mutex_lock_nested() interface needs to be specialised for each tree, but that doesn't look
hard -- the one in linux/fs.h (inode_i_mutex_lock_class) is more complex than most. It looks
like a parent/child locking rule would be sufficient for most trees.