Re: [PATCH v15 16/26] nfsd: add LOCALIO support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> On Sep 3, 2024, at 12:09 PM, Mike Snitzer <snitzer@xxxxxxxxxx> wrote:
> 
> On Tue, Sep 03, 2024 at 03:59:31PM +0000, Chuck Lever III wrote:
>> 
>> 
>>> On Sep 3, 2024, at 11:29 AM, Mike Snitzer <snitzer@xxxxxxxxxx> wrote:
>>> 
>>> I had to double check but I did add a comment that speaks directly to
>>> this "nuance" above the code you quoted:
>>> 
>>>       /*
>>>        * uuid->net must not be NULL, otherwise NFS may not have ref
>>>        * on NFSD and therefore cannot safely make 'nfs_to' calls.
>>>        */
>>> 
>>> So yeah, this code needs to stay like this.  The __must_hold(rcu) just
>>> ensures the RCU is held on entry and exit.. the bouncing of RCU
>>> (dropping and retaking) isn't of immediate concern is it?  While I
>>> agree it isn't ideal, it is what it is given:
>>> 1) NFS caller of NFSD symbol is only safe if it has RCU amd verified
>>>  uuid->net valid
>>> 2) nfsd_file_do_acquire() can allocate.
>> 
>> OK, understood, but the annotation is still wrong. The lock
>> is dropped here so I think you need __releases and __acquires
>> in that case. However...
> 
> Sure, that seems like more precise context with which to train
> lockdep.
> 
>> Let's wait for Neil's comments, but I think this needs to be
>> properly addressed before merging. The comments are not going
>> to be enough IMO.
> 
> I obviously have no issues with Neil confirming/expanding what I
> shared about the need for checking uuid->net with RCU held to ensure
> it safe to call this nfs_to method.  Without it we cannot make the
> call, which happens to then take other references (nfsd_serv and
> nfsd_file) that we can then lean on for the duration of the NFS client
> issuing IO and then dropping the references/interlock when completing
> the IO.
> 
> The NFS client maintainers need to give a good review anyway, so
> plenty of time for Neil to weigh in.

I forgot to mention before: I don't see any other issues
at this point.

Acked-by: Chuck Lever <chuck.lever@xxxxxxxxxx <mailto:chuck.lever@xxxxxxxxxx>>


--
Chuck Lever






[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux