Re: [PATCH 0/6 v2] nfs_localio: fixes for races and errors from older compilers

Chuck Lever
2025-05-09T16:01:46Z

[ adding Paul McK ]

On 5/8/25 8:46 PM, NeilBrown wrote:
> This is a revised version a the earlier series. I've actually tested
> this time and fixed a few issues including the one that Mike found.

As Mike mentioned in a previous thread, at this point, any fix for this
issue will need to be applied to recent stable kernels as well. This
series looks a bit too complicated for that.

I expect that other subsystems will encounter this issue eventually,
so it would be beneficial to address the root cause. For that purpose, I
think I like Vincent's proposal the best:

https://lore.kernel.org/linux-nfs/8c67a295-8caa-4e53-a764-f691657bbe62@wanadoo.fr/raw

None of this is to say that Neil's patches shouldn't be applied. But
perhaps these are not a broad solution to the RCU compilation issue.

> Original description:
> Following the reports of older compilers complaining about the rcu
> annotations in nfs-localio I reviewed the relevant code and found some
> races and opportunities for simplification.
>
> Thanks,
> NeilBrown
>
> [PATCH 1/6] nfs_localio: use cmpxchg() to install new
> [PATCH 2/6] nfs_localio: always hold nfsd net ref with nfsd_file ref
> [PATCH 3/6] nfs_localio: simplify interface to nfsd for getting
> [PATCH 4/6] nfs_localio: duplicate nfs_close_local_fh()
> [PATCH 5/6] nfs_localio: protect race between nfs_uuid_put() and
> [PATCH 6/6] nfs_localio: change nfsd_file_put_local() to take a

--
Chuck Lever