Re: [PATCH v2] nfs: add dummy definition for nfsd_file

Vincent Mailhol
2025-04-23T10:04:27Z

On 23/04/2025 at 18:09, NeilBrown wrote:
> On Wed, 23 Apr 2025, Vincent Mailhol wrote:
>> On 23/04/2025 at 09:32, NeilBrown wrote:
>>> On Wed, 23 Apr 2025, Pali Rohár wrote:
>>>> On Wednesday 23 April 2025 07:54:40 NeilBrown wrote:
>>>>> On Wed, 23 Apr 2025, Pali Rohár wrote:
>>
>> (...)
>>
>>>>> Actually I do object to this fix (though I've been busy and hadn't had
>>>>> much change to look at it properly).
>>>>> The fix is ugly. At the very least it should be wrapping in an
>>>>> #if GCC_VERSION < whatever
>>
>> I acknowledge that the fix is a bit ugly, but Mike is the only one who
>> has proposed a solution so far.
>
> FYI here is my current patch which fixes this problem and a few other
> problems, but doesn't fix everything I (think I) have found, and may
> introduce some problems because some of the interactions are subtle and
> need careful review.
>
> Once I'm confident of it I hope to break it up into individual patches
> and submit.

OK. Glad to hear that you are working on an alternative. If you have something
backing, then I will let you continue.

> The key idea for fixing this problem is to pass a pointer to the rcu
> pointer to the function on the nfsd side where it can dereference it
> sensibly.
> I haven't got all the rcu annotations right yet so build testing isn't
> completely conclusive.
>
> I think the pointer that is passed to nfsd needs to be
>
> struct nfsd_file * __rcu * nfp;
>
> i.e. the __rcu needs to be between the two "*". But to test that I
> would need a newer sparse (I hope that will be sufficient). My current
> sparse install spits way too many errors to be taken seriously.

sparse did not have an official release since v0.6.4 for the last four years. It
is not possible to rely on the distro package anymore. You need to download the
latest sources and either install it, or like I sometimes do, use the CHECK variable

make CHECK=<path_to_sparse/sparse> C=1 -j$(nproc)