Re: [PATCH] vfs: keep the mount pinned while waiting for a parent delegation break

From: Zhao Gongyi

Date: Mon Oct 19 2026 - 02:38:13 EST


On 10/19/26 12:30 AM, Christian Brauner wrote:
> On Fri, Oct 16, 2026 at 07:38:45PM +0100, Al Viro wrote:
>>> So why not have it acquire an active superblock reference at the
>>> same time? We don't need struct mount reference there - all it
>>> takes in increment of inode->i_sb->s_active on try_break_deleg()
>>> side and deactivate_super() on ->i_sb fetched *before* iput()
>>> of ->di_inode on the break_deleg_wait() side...
>>>
>>> No need to mess with every user of that thing...
>
> Yeah, I like that a lot better than touching every caller. All the
> break_deleg_wait() callers wait in plain process context with the locks
> already dropped so deactivate_super() is fine there and the next caller
> can't get it wrong.
>
> Please respin it that way. Mind the missing & on s_active in the sketch.
>


Hi Al and Christian,

Thanks for the suggestion. I've respun the fix in the delegation
helpers. try_break_deleg() now takes an active superblock reference
when it retains the inode, and break_deleg_wait() drops it after
iput(). The atomic_inc() call uses &inode->i_sb->s_active, as
Christian noted.

I built the updated code with KASAN enabled and reran all five
reproducers on arm64 KVM. They completed without crashes or kernel
warnings, and stack samples confirmed the delegation wait paths
were exercised.

I'll send v2 separately.

Thanks,
Gongyi