aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4proc.c
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2012-09-14 17:24:32 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-10-01 18:33:33 -0400
commit05f4c350ee02e9461c6ae3a880ea326a06835e37 (patch)
tree847e24e55e47c06fcb46106b4922b915bb0109e6 /fs/nfs/nfs4proc.c
parente984a55a7418f777407c7edbb2bdf5eb9559b5e2 (diff)
NFS: Discover NFSv4 server trunking when mounting
"Server trunking" is a fancy named for a multi-homed NFS server. Trunking might occur if a client sends NFS requests for a single workload to multiple network interfaces on the same server. There are some implications for NFSv4 state management that make it useful for a client to know if a single NFSv4 server instance is multi-homed. (Note this is only a consideration for NFSv4, not for legacy versions of NFS, which are stateless). If a client cares about server trunking, no NFSv4 operations can proceed until that client determines who it is talking to. Thus server IP trunking discovery must be done when the client first encounters an unfamiliar server IP address. The nfs_get_client() function walks the nfs_client_list and matches on server IP address. The outcome of that walk tells us immediately if we have an unfamiliar server IP address. It invokes nfs_init_client() in this case. Thus, nfs4_init_client() is a good spot to perform trunking discovery. Discovery requires a client to establish a fresh client ID, so our client will now send SETCLIENTID or EXCHANGE_ID as the first NFS operation after a successful ping, rather than waiting for an application to perform an operation that requires NFSv4 state. The exact process for detecting trunking is different for NFSv4.0 and NFSv4.1, so a minorversion-specific init_client callout method is introduced. CLID_INUSE recovery is important for the trunking discovery process. CLID_INUSE is a sign the server recognizes the client's nfs_client_id4 id string, but the client is using the wrong principal this time for the SETCLIENTID operation. The SETCLIENTID must be retried with a series of different principals until one works, and then the rest of trunking discovery can proceed. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r--fs/nfs/nfs4proc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 461411171966..b5834abfcbff 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -5458,6 +5458,8 @@ int nfs4_destroy_clientid(struct nfs_client *clp)
5458 goto out; 5458 goto out;
5459 if (clp->cl_exchange_flags == 0) 5459 if (clp->cl_exchange_flags == 0)
5460 goto out; 5460 goto out;
5461 if (clp->cl_preserve_clid)
5462 goto out;
5461 cred = nfs4_get_exchange_id_cred(clp); 5463 cred = nfs4_get_exchange_id_cred(clp);
5462 ret = nfs4_proc_destroy_clientid(clp, cred); 5464 ret = nfs4_proc_destroy_clientid(clp, cred);
5463 if (cred) 5465 if (cred)
@@ -6871,6 +6873,7 @@ static const struct nfs4_state_recovery_ops nfs40_reboot_recovery_ops = {
6871 .recover_lock = nfs4_lock_reclaim, 6873 .recover_lock = nfs4_lock_reclaim,
6872 .establish_clid = nfs4_init_clientid, 6874 .establish_clid = nfs4_init_clientid,
6873 .get_clid_cred = nfs4_get_setclientid_cred, 6875 .get_clid_cred = nfs4_get_setclientid_cred,
6876 .detect_trunking = nfs40_discover_server_trunking,
6874}; 6877};
6875 6878
6876#if defined(CONFIG_NFS_V4_1) 6879#if defined(CONFIG_NFS_V4_1)
@@ -6882,6 +6885,7 @@ static const struct nfs4_state_recovery_ops nfs41_reboot_recovery_ops = {
6882 .establish_clid = nfs41_init_clientid, 6885 .establish_clid = nfs41_init_clientid,
6883 .get_clid_cred = nfs4_get_exchange_id_cred, 6886 .get_clid_cred = nfs4_get_exchange_id_cred,
6884 .reclaim_complete = nfs41_proc_reclaim_complete, 6887 .reclaim_complete = nfs41_proc_reclaim_complete,
6888 .detect_trunking = nfs41_discover_server_trunking,
6885}; 6889};
6886#endif /* CONFIG_NFS_V4_1 */ 6890#endif /* CONFIG_NFS_V4_1 */
6887 6891