Chuck Lever f11ad7aa65 NFSD: Fix verifier returned in stable WRITEs
RFC 8881 explains the purpose of the write verifier this way:

> The final portion of the result is the field writeverf. This field
> is the write verifier and is a cookie that the client can use to
> determine whether a server has changed instance state (e.g., server
> restart) between a call to WRITE and a subsequent call to either
> WRITE or COMMIT.

But then it says:

> This cookie MUST be unchanged during a single instance of the
> NFSv4.1 server and MUST be unique between instances of the NFSv4.1
> server. If the cookie changes, then the client MUST assume that
> any data written with an UNSTABLE4 value for committed and an old
> writeverf in the reply has been lost and will need to be
> recovered.

RFC 1813 has similar language for NFSv3. NFSv2 does not have a write
verifier since it doesn't implement the COMMIT procedure.

Since commit 19e0663ff9bc ("nfsd: Ensure sampling of the write
verifier is atomic with the write"), the Linux NFS server has
returned a boot-time-based verifier for UNSTABLE WRITEs, but a zero
verifier for FILE_SYNC and DATA_SYNC WRITEs. FILE_SYNC and DATA_SYNC
WRITEs are not followed up with a COMMIT, so there's no need for
clients to compare verifiers for stable writes.

However, by returning a different verifier for stable and unstable
writes, the above commit puts the Linux NFS server a step farther
out of compliance with the first MUST above. At least one NFS client
(FreeBSD) noticed the difference, making this a potential
regression.

Reported-by: Rick Macklem <rmacklem@uoguelph.ca>
Link: https://lore.kernel.org/linux-nfs/YQXPR0101MB096857EEACF04A6DF1FC6D9BDD749@YQXPR0101MB0968.CANPRD01.PROD.OUTLOOK.COM/T/
Fixes: 19e0663ff9bc ("nfsd: Ensure sampling of the write verifier is atomic with the write")
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2022-01-08 14:42:02 -05:00
..
2021-11-10 21:16:56 +00:00
2021-11-10 21:17:09 +00:00
2021-08-19 09:02:55 +09:00
2021-12-10 17:28:02 -08:00
2021-11-09 10:02:51 -08:00
2021-10-25 19:11:50 -07:00
2021-04-12 15:04:29 +02:00
2021-11-13 15:32:30 -08:00
2021-11-01 10:25:27 -07:00
2021-12-02 12:41:10 +01:00
2021-08-26 22:28:02 +02:00
2021-11-03 09:23:25 -07:00
2021-12-07 15:47:09 +00:00
2021-11-09 10:51:12 -08:00
\n
2021-11-06 16:40:48 -07:00
\n
2021-11-06 16:40:48 -07:00
2021-11-09 12:53:58 +01:00
2021-08-19 09:02:55 +09:00
2021-11-17 09:26:09 +01:00
2021-10-18 14:43:22 -06:00
2021-08-31 11:13:35 -07:00
2021-09-09 13:25:49 -07:00
2021-11-17 10:36:35 -05:00
2021-10-19 05:49:54 -06:00
2021-08-31 11:06:32 -07:00
2021-10-19 14:11:39 -04:00
2021-11-01 09:06:53 -07:00
2021-12-09 10:49:56 -08:00
2021-08-10 17:57:22 +02:00