Subject: Re: [nfsv4] ESXi NFSv4.1 client's use of ReclaimComplete

From: [email-masked] (J. Bruce Fields)
Date: Thu, 2 Aug 2018 10:05:05 -0400

On Mon, Jul 09, 2018 at 10:40:21PM +0000, Rick Macklem wrote:
> Since FreeBSD never transfers a file system to a different server, it
> returns NFS4ERR_NOTSUPP for the "rca_one_fs == TRUE" case.
> 
> Have I misinterpreted the above?
> 
> If not, I am surprised that this client works for any NFSv4.1 server, but
> apparently it does.

Are you sure it wasn't your NFS4ERR_NOTSUPP that was preventing the
client from following up with a RECLAIM_COMPLETE with rca_one_fs false?

The linux server won't allow any opens until the client sends a
RECLAIM_COMPLETE with rca_one_fs false, so, yeah, otherwise the ESXi
client would never work with the linux server.  Or any correct server--I
think the server's actually required to enforce that.

As you note, we treat the rca_one_fs true case as a no-op (except for
checking that the client respected the spec by setting a current
filehandle in that case).  So a RECLAIM_COMPLETE with rca_one_fs true
wouldn't be enough for us to start allowing opens.

--b.

---

From: Rick Macklem <[email-masked]>
Date: Thu, 2 Aug 2018 15:03:02 +0000

>client from following up with a RECLAIM_COMPLETE with rca_one_fs false?
Yes, that was what prevented the mount from working. (It decided to be
read-only actually.)

The problem is that sometimes it did the ReclaimComplete with rca_one_fs == true
after having done one with rca_one_fs == false and when the FreeBSD server replied
NFS4ERR_ALREADY_COMPLETE (which I think was a correct response for this case),
the client would fail the mount. (After I got rid of the NFS4ERR_NOTSUPP reply.)
I've changed the FreeBSD server to do the same as the Linux one (as below), but I
did also add a flag to disable the NFS4ERR_GRACE replies after the first ReclaimCompletre
is done, as suggested by David Noveck.
(Just fyi, the ESXi 6.7 client is much better behaved than the ESXi 6.5 one.)
>wouldn't be enough for us to start allowing opens.

rick