Hi folks,
I'd like to understand the need for doing a double SETCLIENTID by the
client. Initial mount calls nfs4_init_client() which initiates
trunking discovery and calls nfs40_discover_client_trunking() which
ends up sending the SETCLIENTID to the server. However, then on the
first open, the client calls _nfs4_do_open() which calls
nfs4_client_recover_expired_lease() which checks the flags and finds
NFS4CLNT_LEASE_EXPIRED set which triggers another SETCLIENTID.
Client is created in nfs4_alloc_client() with cl_flags having
NFS4CLNT_LEASE_EXPIRED. But why doesn't a successful SETCLIENTID clear
the LEASE_EXPIRED?
If we were to clear the LEASE_EXPIRED flag (which seems like the right
thing after establishing a valid clientid), then open would find a
non-expired state.
Thoughts?
diff --git a/fs/nfs/nfs4client.c b/fs/nfs/nfs4client.c
index 9796314..9ad6110 100644
--- a/fs/nfs/nfs4client.c
+++ b/fs/nfs/nfs4client.c
@@ -581,6 +581,7 @@ int nfs40_walk_client_list(struct nfs_client *new,
nfs4_swap_callback_idents(pos, new);
pos->cl_confirm = new->cl_confirm;
nfs_mark_client_ready(pos, NFS_CS_READY);
+ clear_bit(NFS4CLNT_LEASE_EXPIRED, &pos->cl_state);
prev = NULL;
*result = pos;