Re: [syzbot] [mm?] BUG: sleeping function called from invalid context in shmem_undo_range
From: Andrew Morton
Date: Fri Apr 24 2026 - 06:43:55 EST
On Thu, 23 Apr 2026 19:34:54 -0700 Arjan van de Ven <arjan@xxxxxxxxxxxxxxx> wrote:
> This email is created by automation to help kernel developers
> deal with a large volume of AI generated bug reports by decoding
> oopses into more actionable information.
Thanks ;)
>
> ...
>
> Potential Solution
>
> Find the rcu_read_lock() call that is missing its matching
> rcu_read_unlock() in the vfs_unlink() / fsnotify_unlink() /
> d_delete_notify() code path. Adding a WARN_ON(rcu_read_lock_held())
> to iput() (alongside the existing might_sleep() check) should produce
> a backtrace pointing at the exact acquisition site on the next
> reproduction.
yup, if we had a reproducer!
What's missing from the lockdep report is the one thing we want to know
- where did that rcu_read_lock() occur? All we have is
> #1: ffffffff8e7e5260 (rcu_read_lock){....}-{1:3}, at: rcu_lock_acquire.constprop.0+0x7/0x30 include/linux/rcupdate.h:300
which isn't very useful! lockdep records the stack trace for the
acquisition site, so why didn't we get to see that?