From cbba8c4a05d643e07543b9d48b8ce619bcba8e9e Mon Sep 17 00:00:00 2001 From: Chuck Lever Date: Thu, 1 Jun 2017 12:03:38 -0400 Subject: [PATCH] NFSv4.1: Use seqid returned by EXCHANGE_ID after state migration Transparent State Migration copies a client's lease state from the server where a filesystem used to reside to the server where it now resides. When an NFSv4.1 client first contacts that destination server, it uses EXCHANGE_ID to detect trunking relationships. The lease that was copied there is returned to that client, but the destination server sets EXCHGID4_FLAG_CONFIRMED_R when replying to the client. This is because the lease was confirmed on the source server (before it was copied). Normally, when CONFIRMED_R is set, a client purges the lease and creates a new one. However, that throws away the entire benefit of Transparent State Migration. Therefore, the client must use the contrived slot sequence value returned by the destination server for its first CREATE_SESSION operation after a Transparent State Migration. Orabug: 25802443 Reported-by: Xuan Qi Signed-off-by: Chuck Lever (hand picked mainline 838edb9 NFSv4.1: Use seqid returned ...) Signed-off-by: Manjunath Patil --- fs/nfs/nfs4proc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 2c935fac6809..46b4a6a4a60b 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -6912,12 +6912,11 @@ static int _nfs4_proc_exchange_id(struct nfs_client *clp, struct rpc_cred *cred, if (status == 0) { clp->cl_clientid = res.clientid; clp->cl_exchange_flags = res.flags; + clp->cl_seqid = res.seqid; /* Client ID is not confirmed */ - if (!(res.flags & EXCHGID4_FLAG_CONFIRMED_R)) { + if (!(res.flags & EXCHGID4_FLAG_CONFIRMED_R)) clear_bit(NFS4_SESSION_ESTABLISHED, &clp->cl_session->session_state); - clp->cl_seqid = res.seqid; - } kfree(clp->cl_serverowner); clp->cl_serverowner = res.server_owner; -- 2.50.1