Re: [PATCH] NFSD: restart ssc_expire_umount walk after dropping nfsd_ssc_lock

From: Jeff Layton

Date: Sat May 23 2026 - 07:10:35 EST


On Sat, 2026-05-23 at 07:02 -0400, Michael Bommarito wrote:
> On Sat, May 23, 2026 at 6:55 AM Jeff Layton <jlayton@xxxxxxxxxx> wrote:
> > Comment is a bit confusing, given that you replaced
> > list_for_each_entry_safe() with list_for_each_entry().
>
> Sorry, that's left over from an earlier patch attempt that introduced
> a different issue. How would this comment look?
>
> Concurrent nfsd4_ssc_cancel_dul() can free an item while spinlock is
> dropped for mntput() above, so restart the walk from the head so no
> stale pointer is followed.


Sure, looks good. FWIW, the "restart the loop after dropping the lock"
pattern is pretty common across the kernel, but it is good to lay out
the rationale in a comment.
--
Jeff Layton <jlayton@xxxxxxxxxx>