aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4proc.c
diff options
context:
space:
mode:
authorWeston Andros Adamson <dros@netapp.com>2011-05-31 19:05:47 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2011-07-12 13:40:27 -0400
commit78fe0f41d9937ee62817912ac8d627e06243c269 (patch)
tree7ae4ac3f9675ecbddb5ec0c4615313ae899c10da /fs/nfs/nfs4proc.c
parent7e574f0d3911c5cc60d4d2b57fee975c462d6cd0 (diff)
NFS: use scope from exchange_id to skip reclaim
can be skipped if the "eir_server_scope" from the exchange_id proc differs from previous calls. Also, in the future server_scope will be useful for determining whether client trunking is available Signed-off-by: Weston Andros Adamson <dros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r--fs/nfs/nfs4proc.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 5879b23e0c99..5f4912f72282 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -4781,6 +4781,16 @@ out_inval:
4781 return -NFS4ERR_INVAL; 4781 return -NFS4ERR_INVAL;
4782} 4782}
4783 4783
4784static bool
4785nfs41_same_server_scope(struct server_scope *a, struct server_scope *b)
4786{
4787 if (a->server_scope_sz == b->server_scope_sz &&
4788 memcmp(a->server_scope, b->server_scope, a->server_scope_sz) == 0)
4789 return true;
4790
4791 return false;
4792}
4793
4784/* 4794/*
4785 * nfs4_proc_exchange_id() 4795 * nfs4_proc_exchange_id()
4786 * 4796 *
@@ -4823,9 +4833,31 @@ int nfs4_proc_exchange_id(struct nfs_client *clp, struct rpc_cred *cred)
4823 init_utsname()->domainname, 4833 init_utsname()->domainname,
4824 clp->cl_rpcclient->cl_auth->au_flavor); 4834 clp->cl_rpcclient->cl_auth->au_flavor);
4825 4835
4836 res.server_scope = kzalloc(sizeof(struct server_scope), GFP_KERNEL);
4837 if (unlikely(!res.server_scope))
4838 return -ENOMEM;
4839
4826 status = rpc_call_sync(clp->cl_rpcclient, &msg, RPC_TASK_TIMEOUT); 4840 status = rpc_call_sync(clp->cl_rpcclient, &msg, RPC_TASK_TIMEOUT);
4827 if (!status) 4841 if (!status)
4828 status = nfs4_check_cl_exchange_flags(clp->cl_exchange_flags); 4842 status = nfs4_check_cl_exchange_flags(clp->cl_exchange_flags);
4843
4844 if (!status) {
4845 if (clp->server_scope &&
4846 !nfs41_same_server_scope(clp->server_scope,
4847 res.server_scope)) {
4848 dprintk("%s: server_scope mismatch detected\n",
4849 __func__);
4850 set_bit(NFS4CLNT_SERVER_SCOPE_MISMATCH, &clp->cl_state);
4851 kfree(clp->server_scope);
4852 clp->server_scope = NULL;
4853 }
4854
4855 if (!clp->server_scope)
4856 clp->server_scope = res.server_scope;
4857 else
4858 kfree(res.server_scope);
4859 }
4860
4829 dprintk("<-- %s status= %d\n", __func__, status); 4861 dprintk("<-- %s status= %d\n", __func__, status);
4830 return status; 4862 return status;
4831} 4863}