Subject: Re: [nfsv4] Issues with read chunk description in RFC8166.

From: Chuck Lever <[email-masked]>
Date: Tue, 18 Dec 2018 15:20:56 -0500

> On Nov 30, 2018, at 4:29 PM, Chuck Lever <[email-masked]> wrote:
> 
> Hi Olga-
> 
>> On Nov 30, 2018, at 4:16 PM, Olga Kornievskaia <[email-masked]> wrote:
>> 
>> On Mon, Nov 19, 2018 at 5:51 PM Chuck Lever <[email-masked]> wrote:
>>> 
>>> 
>>> 
>>>> On Nov 19, 2018, at 5:34 PM, David Noveck <[email-masked]> wrote:
>>>> 
>>>>> Have you seen a client that sends an incorrect value in the position
>>>>> field?
>>>> 
>>>> Never saw that.
>>>> 
>>>>> If that's rare or hasn't occurred, then returning ERR_CHUNK
>>>>> is not problematic.
>>>> 
>>>> True.
>>>> 
>>>>> For the second case, how many extra bytes are in the bad Read chunk?
>>>> 
>>>> sixteen.   The data length field was 0x4000 and the length in the read chunk was
>>>> 0x4010.   For all I know, it might be rare, but I suspect it isn't.
>>>> 
>>>>> Clients are allowed to include the XDR pad in the chunk, and servers
>>>>> are required to ignore it.
>>>> 
>>>> In any case, this is over three bytes.
>>> 
>>> 16 bytes is the size of an NFSv4 GETATTR operation. I suspect you
>>> are using an old broken client that incorrectly includes the
>>> trailing part of the compound in the Read chunk.
>> 
>> I don't believe this is an issue with client sending incorrect values
>> (btw this is 4.18-rc2 client being tested, so somewhat old. I'll
>> update it soon).
> 
> This is a bug that was supposed to have been fixed years ago.
> If this is still happening in v4.18-era kernels, it may have
> been re-introduced or there's some other problem that needs
> to be tracked down.

I instrumented a Linux NFS server to capture cases where the Read chunk
is longer than the data payload (modulo XDR padding) of NFS WRITEs. I've
run several workloads including filesystem regression tests, software
builds, and multi-threaded WRITE workloads.

I used vers=4.0 and vers=4.1, and sec=sys (since you reported you don't
have Kerberos working with your server prototype).

With the v4.20-rc Linux NFS/RDMA client implementation, I've not been
able to reproduce an NFS WRITE with an oversize Read chunk.

--
Chuck Lever