On Tue, 2 Jul 2024 at 10:03, Mateusz Guzik <mjguzik@xxxxxxxxx> wrote: > > I was thinking a different approach. > > A lookup variant which resolves everything and returns the dentry + an > information whether this is rcu mode. That would work equally. But the end result ends up being very similar: you need to hook into that final complete_walk() -> try_to_unlazy() -> legitimize_path() and check a flag whether you actually then do "get_lockref_or_dead()" or not. It really *shouldn't* be too bad, but this is just so subtle code that it just takes a lot of care. Even if the patch itself ends up not necessarily being very large. As mentioned, I've looked at it, but it always ended up being _just_ scary enough that I never really started doing it. Linus