freebsd-dev/sys/fs/nfsserver
Rick Macklem ff45b9fc1a Bjorn reported a problem where the Linux NFSv4.1 client is
using an open_to_lock_owner4 when that lock_owner4 has already
been created by a previous open_to_lock_owner4. This caused the NFS server
to reply NFSERR_INVAL.

For NFSv4.0, this is an error, although the updated NFSv4.0 RFC7530 notes
that the correct error reply is NFSERR_BADSEQID (RFC3530 did not specify
what error to return).

For NFSv4.1, it is not obvious whether or not this is allowed by RFC5661,
but the NFSv4.1 server can handle this case without error.
This patch changes the NFSv4.1 (and NFSv4.2) server to handle multiple
uses of the same lock_owner in open_to_lock_owner so that it now correctly
interoperates with the Linux NFS client.
It also changes the error returned for NFSv4.0 to be NFSERR_BADSEQID.

Thanks go to Bjorn for diagnosing this and testing the patch.
He also provided a program that I could use to reproduce the problem.

Tested by:	bj@cebitec.uni-bielefeld.de (Bjorn Fischer)
PR:		249567
Reported by:	bj@cebitec.uni-bielefeld.de (Bjorn Fischer)
MFC after:	3 days
2020-09-26 23:05:38 +00:00
..
nfs_fha_new.c fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00
nfs_fha_new.h Re-organize the NFS file handle affinity code for the NFS server. 2020-04-14 00:01:26 +00:00
nfs_nfsdcache.c fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00
nfs_nfsdkrpc.c fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00
nfs_nfsdport.c fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00
nfs_nfsdserv.c fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00
nfs_nfsdsocket.c fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00
nfs_nfsdstate.c Bjorn reported a problem where the Linux NFSv4.1 client is 2020-09-26 23:05:38 +00:00
nfs_nfsdsubs.c fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00