Re: [PATCH AUTOSEL 6.12 486/486] kernfs: Use RCU to access kernfs_node::parent.

From: Christian Loehle

Date: Tue Nov 17 2026 - 05:51:24 EST


On 11/13/26 19:10, Sasha Levin wrote:
> On 5/5/25 23:39, Sasha Levin wrote:
>> Subject: [PATCH AUTOSEL 6.12 486/486] kernfs: Use RCU to access kernfs_node::parent.
>
> On Fri, Nov 13, 2026, Christian Loehle wrote:
>> I just stumbled over this issue on a 6.12 stable kernel,
>> any reason this patch wasn't applied back then?
>> Can we apply the backport now?
>
> 633488947ef6 ("kernfs: Use RCU to access kernfs_node::parent.") is a
> preparatory refactor with no Fixes: or Cc: stable. It is part of a series whose
> other patches are not in 6.12 either, and it has fixups upstream, so it is not
> a clean backport.
>
> What failure are you seeing on 6.12 (oops, lockdep splat, trace)? If you can
> send it, we can look for the fix that addresses it directly.
>

Sorry, my bad, this should've been to ::name, later in the series.
Here's a lockdep:

[ 7.291918] [ BUG: Invalid wait context ]
[ 7.292932] 6.12.117-kernfs-intree #3 Not tainted
[ 7.293486] -----------------------------
[ 7.293808] repro/92 is trying to lock:
[ 7.294275] ffffffff81effa18 (kernfs_rename_lock){....}-{3:3}, at: kernfs_path_from_node+0x26/0x60
[ 7.297072] other info that might help us debug this:
[ 7.298307] context-{5:5}
[ 7.298739] 5 locks held by repro/92:
[ 7.299157] #0: ff11000000d90b20 (&vma->vm_lock->lock){++++}-{4:4}, at: lock_vma_under_rcu+0x91/0x410
[ 7.300199] #1: ffffffff81eb2900 (rcu_read_lock){....}-{1:3}, at: __pte_offset_map+0x26/0x1a0
[ 7.300931] #2: ff1100003ea2c218 (&rq->__lock){-.-.}-{2:2}, at: __schedule+0xb4/0x8f0
[ 7.301590] #3: ffffffff81eb2900 (rcu_read_lock){....}-{1:3}, at: bpf_trace_run2+0x7b/0x1e0
[ 7.302469] #4: ff11000000f0b0f8 (&mm->mmap_lock){++++}-{4:4}, at: stack_map_get_build_id_offset+0xbd/0x300
[ 7.303319] stack backtrace:
[ 7.303979] CPU: 0 UID: 0 PID: 92 Comm: repro Not tainted 6.12.117-kernfs-intree #3
[ 7.304499] Call Trace:
[ 7.304737] <TASK>
[ 7.304970] ? dump_stack_lvl+0x64/0x90
[ 7.305089] ? __lock_acquire+0xb05/0x25d0
[ 7.305130] ? __lock_acquire+0x404/0x25d0
[ 7.305171] ? lock_acquire+0xb3/0x290
[ 7.305194] ? kernfs_path_from_node+0x26/0x60
[ 7.305222] ? find_held_lock+0x2b/0x80
[ 7.305252] ? _raw_read_lock_irqsave+0x72/0x90
[ 7.305277] ? kernfs_path_from_node+0x26/0x60
[ 7.305297] ? kernfs_path_from_node+0x26/0x60
[ 7.305321] ? get_mm_memcg_path.part.0.constprop.0+0x36/0x150
[ 7.305350] ? __mmap_lock_do_trace_acquire_returned+0x54/0xe0
[ 7.305394] ? lock_acquire+0xb3/0x290
[ 7.305432] ? stack_map_get_build_id_offset+0xbd/0x300
[ 7.305465] ? lock_is_held_type+0x97/0x110
[ 7.305511] ? down_read_trylock+0xa9/0x130
[ 7.305551] ? stack_map_get_build_id_offset+0x2d1/0x300
[ 7.305616] ? __bpf_get_stack+0x3a9/0x400
[ 7.305674] ? bpf_get_stack_raw_tp+0x7a/0xa0
[ 7.305713] ? bpf_prog_ec3b2eefa702d8d3+0x3b/0x3f
[ 7.306445] ? bpf_trace_run2+0xc4/0x1e0
[ 7.306478] ? set_next_entity+0x97/0x130
[ 7.306512] ? switch_mm_irqs_off+0x4a6/0x570
[ 7.306546] ? __schedule+0x2f3/0x8f0
[ 7.306585] ? preempt_schedule+0x33/0x50
[ 7.306608] ? preempt_schedule_thunk+0x16/0x30
[ 7.306646] ? _raw_spin_unlock+0x2f/0x40
[ 7.306672] ? wp_page_copy+0x2f9/0x8b0
[ 7.306711] ? __handle_mm_fault+0xa3d/0x19e0
[ 7.306757] ? handle_mm_fault+0xb0/0x360
[ 7.306784] ? exc_page_fault+0x240/0x8c0
[ 7.306824] ? asm_exc_page_fault+0x22/0x30
[ 7.306949] </TASK>