Subject: [nfsv4] proposed change to RFC-7862 to align Copy semantics with that expected by the Linux client

From: Rick Macklem <[email-masked]>
Date: Fri, 25 Oct 2019 01:26:58 +0000

The Linux NFSv4.2 client does not expect a NFS4ERR_INVAL reply to a Copy
when the source offset plus count exceeds the source file size.
It does expect a reply of NFS4_OK with a copied count (wr_count) equal
zero when the source offset is equal to or greater than the source file size.
It expects a reply that copied a maximum of "source_file_size - ca_src_offset"
when source offset plus count exceeds source file size.

I propose that the following modification be made to RFC-7862 in order to
to change the defined server reply for the above case, so that future NFSv4.2
server implementations can interoperate with the extant Linux client implementation that is shipping to users.
This can be done without disruption since there
are no clients that expect the behaviour described in RFC-7862 at this time.

Replace the sentence at top of page #67:
   If the source offset or the source offset plus count is greater than
   the size of the source file, the operation MUST fail with
   NFS4ERR_INVAL.

with:
   If the source offset is greater than or equal to the size of the
   source file, the operation will return NFS4_OK with zero bytes copied.
   If the source offset plus count is greater than the size of the
   source file, the operation will copy at least one byte and at most
   "size_of_source_file - source_offset" bytes.

rick