]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
nfscl: Send stateid.seqid of 0 for NFSv4.1/4.2 mounts
authorRick Macklem <rmacklem@FreeBSD.org>
Tue, 20 Jul 2021 00:35:39 +0000 (17:35 -0700)
committerRick Macklem <rmacklem@FreeBSD.org>
Tue, 20 Jul 2021 00:35:39 +0000 (17:35 -0700)
commit7685f8344d9a59e9498bdfebb48066f98216fecd
tree9ee8fa6b4fe32b5ed4ef64e6a5eea0da893b68ef
parentb5e73dd952f9d5224e9e076bb9719f7bcec871b0
nfscl: Send stateid.seqid of 0 for NFSv4.1/4.2 mounts

For NFSv4.1/4.2, the client may set the "seqid" field of the
stateid to 0 in RPC requests.  This indicates to the server that
it should not check the "seqid" or return NFSERR_OLDSTATEID if the
"seqid" value is not up to date w.r.t. Open/Lock operations
on the stateid.  This "seqid" is incremented by the NFSv4 server
for each Open/OpenDowngrade/Lock/Locku operation done on the stateid.

Since a failure return of NFSERR_OLDSTATEID is of no use to
the client for I/O operations, it makes sense to set "seqid"
to 0 for the stateid argument for I/O operations.
This avoids server failure replies of NFSERR_OLDSTATEID,
although I am not aware of any case where this failure occurs.

This makes the FreeBSD NFSv4.1/4.2 client compatible with the
Linux NFSv4.1/4.2 client.

MFC after: 2 weeks
sys/fs/nfsclient/nfs_clstate.c