diff options
-rw-r--r-- | fs/nfs/client.c | 12 | ||||
-rw-r--r-- | fs/nfs/internal.h | 4 | ||||
-rw-r--r-- | fs/nfs/nfs4filelayout.h | 7 | ||||
-rw-r--r-- | fs/nfs/nfs4filelayoutdev.c | 18 |
4 files changed, 30 insertions, 11 deletions
diff --git a/fs/nfs/client.c b/fs/nfs/client.c index 8f1c65210afb..b4e2199c32b3 100644 --- a/fs/nfs/client.c +++ b/fs/nfs/client.c | |||
@@ -1477,8 +1477,8 @@ error: | |||
1477 | * the MDS. | 1477 | * the MDS. |
1478 | */ | 1478 | */ |
1479 | struct nfs_client *nfs4_set_ds_client(struct nfs_client* mds_clp, | 1479 | struct nfs_client *nfs4_set_ds_client(struct nfs_client* mds_clp, |
1480 | const struct sockaddr *ds_addr, | 1480 | const struct sockaddr *ds_addr, int ds_addrlen, |
1481 | int ds_addrlen, int ds_proto) | 1481 | int ds_proto, unsigned int ds_timeo, unsigned int ds_retrans) |
1482 | { | 1482 | { |
1483 | struct nfs_client_initdata cl_init = { | 1483 | struct nfs_client_initdata cl_init = { |
1484 | .addr = ds_addr, | 1484 | .addr = ds_addr, |
@@ -1488,12 +1488,7 @@ struct nfs_client *nfs4_set_ds_client(struct nfs_client* mds_clp, | |||
1488 | .minorversion = mds_clp->cl_minorversion, | 1488 | .minorversion = mds_clp->cl_minorversion, |
1489 | .net = mds_clp->net, | 1489 | .net = mds_clp->net, |
1490 | }; | 1490 | }; |
1491 | struct rpc_timeout ds_timeout = { | 1491 | struct rpc_timeout ds_timeout; |
1492 | .to_initval = 15 * HZ, | ||
1493 | .to_maxval = 15 * HZ, | ||
1494 | .to_retries = 1, | ||
1495 | .to_exponential = 1, | ||
1496 | }; | ||
1497 | struct nfs_client *clp; | 1492 | struct nfs_client *clp; |
1498 | 1493 | ||
1499 | /* | 1494 | /* |
@@ -1501,6 +1496,7 @@ struct nfs_client *nfs4_set_ds_client(struct nfs_client* mds_clp, | |||
1501 | * cl_ipaddr so as to use the same EXCHANGE_ID co_ownerid as the MDS | 1496 | * cl_ipaddr so as to use the same EXCHANGE_ID co_ownerid as the MDS |
1502 | * (section 13.1 RFC 5661). | 1497 | * (section 13.1 RFC 5661). |
1503 | */ | 1498 | */ |
1499 | nfs_init_timeout_values(&ds_timeout, ds_proto, ds_timeo, ds_retrans); | ||
1504 | clp = nfs_get_client(&cl_init, &ds_timeout, mds_clp->cl_ipaddr, | 1500 | clp = nfs_get_client(&cl_init, &ds_timeout, mds_clp->cl_ipaddr, |
1505 | mds_clp->cl_rpcclient->cl_auth->au_flavor, 0); | 1501 | mds_clp->cl_rpcclient->cl_auth->au_flavor, 0); |
1506 | 1502 | ||
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h index 6ed96c7ffcb2..1466c5d88f09 100644 --- a/fs/nfs/internal.h +++ b/fs/nfs/internal.h | |||
@@ -172,7 +172,9 @@ extern void nfs_mark_client_ready(struct nfs_client *clp, int state); | |||
172 | extern int nfs4_check_client_ready(struct nfs_client *clp); | 172 | extern int nfs4_check_client_ready(struct nfs_client *clp); |
173 | extern struct nfs_client *nfs4_set_ds_client(struct nfs_client* mds_clp, | 173 | extern struct nfs_client *nfs4_set_ds_client(struct nfs_client* mds_clp, |
174 | const struct sockaddr *ds_addr, | 174 | const struct sockaddr *ds_addr, |
175 | int ds_addrlen, int ds_proto); | 175 | int ds_addrlen, int ds_proto, |
176 | unsigned int ds_timeo, | ||
177 | unsigned int ds_retrans); | ||
176 | #ifdef CONFIG_PROC_FS | 178 | #ifdef CONFIG_PROC_FS |
177 | extern int __init nfs_fs_proc_init(void); | 179 | extern int __init nfs_fs_proc_init(void); |
178 | extern void nfs_fs_proc_exit(void); | 180 | extern void nfs_fs_proc_exit(void); |
diff --git a/fs/nfs/nfs4filelayout.h b/fs/nfs/nfs4filelayout.h index 2f6330c4ee3e..6fb1901ffd6a 100644 --- a/fs/nfs/nfs4filelayout.h +++ b/fs/nfs/nfs4filelayout.h | |||
@@ -33,6 +33,13 @@ | |||
33 | #include "pnfs.h" | 33 | #include "pnfs.h" |
34 | 34 | ||
35 | /* | 35 | /* |
36 | * Default data server connection timeout and retrans vaules. | ||
37 | * Set by module paramters dataserver_timeo and dataserver_retrans. | ||
38 | */ | ||
39 | #define NFS4_DEF_DS_TIMEO 60 | ||
40 | #define NFS4_DEF_DS_RETRANS 5 | ||
41 | |||
42 | /* | ||
36 | * Field testing shows we need to support up to 4096 stripe indices. | 43 | * Field testing shows we need to support up to 4096 stripe indices. |
37 | * We store each index as a u8 (u32 on the wire) to keep the memory footprint | 44 | * We store each index as a u8 (u32 on the wire) to keep the memory footprint |
38 | * reasonable. This in turn means we support a maximum of 256 | 45 | * reasonable. This in turn means we support a maximum of 256 |
diff --git a/fs/nfs/nfs4filelayoutdev.c b/fs/nfs/nfs4filelayoutdev.c index 7e0be3e331d7..d4d2032c1992 100644 --- a/fs/nfs/nfs4filelayoutdev.c +++ b/fs/nfs/nfs4filelayoutdev.c | |||
@@ -30,12 +30,16 @@ | |||
30 | 30 | ||
31 | #include <linux/nfs_fs.h> | 31 | #include <linux/nfs_fs.h> |
32 | #include <linux/vmalloc.h> | 32 | #include <linux/vmalloc.h> |
33 | #include <linux/module.h> | ||
33 | 34 | ||
34 | #include "internal.h" | 35 | #include "internal.h" |
35 | #include "nfs4filelayout.h" | 36 | #include "nfs4filelayout.h" |
36 | 37 | ||
37 | #define NFSDBG_FACILITY NFSDBG_PNFS_LD | 38 | #define NFSDBG_FACILITY NFSDBG_PNFS_LD |
38 | 39 | ||
40 | static unsigned int dataserver_timeo = NFS4_DEF_DS_TIMEO; | ||
41 | static unsigned int dataserver_retrans = NFS4_DEF_DS_RETRANS; | ||
42 | |||
39 | /* | 43 | /* |
40 | * Data server cache | 44 | * Data server cache |
41 | * | 45 | * |
@@ -165,8 +169,9 @@ nfs4_ds_connect(struct nfs_server *mds_srv, struct nfs4_pnfs_ds *ds) | |||
165 | __func__, ds->ds_remotestr, da->da_remotestr); | 169 | __func__, ds->ds_remotestr, da->da_remotestr); |
166 | 170 | ||
167 | clp = nfs4_set_ds_client(mds_srv->nfs_client, | 171 | clp = nfs4_set_ds_client(mds_srv->nfs_client, |
168 | (struct sockaddr *)&da->da_addr, | 172 | (struct sockaddr *)&da->da_addr, |
169 | da->da_addrlen, IPPROTO_TCP); | 173 | da->da_addrlen, IPPROTO_TCP, |
174 | dataserver_timeo, dataserver_retrans); | ||
170 | if (!IS_ERR(clp)) | 175 | if (!IS_ERR(clp)) |
171 | break; | 176 | break; |
172 | } | 177 | } |
@@ -821,3 +826,12 @@ mark_dev_invalid: | |||
821 | filelayout_mark_devid_invalid(devid); | 826 | filelayout_mark_devid_invalid(devid); |
822 | return NULL; | 827 | return NULL; |
823 | } | 828 | } |
829 | |||
830 | module_param(dataserver_retrans, uint, 0644); | ||
831 | MODULE_PARM_DESC(dataserver_retrans, "The number of times the NFSv4.1 client " | ||
832 | "retries a request before it attempts further " | ||
833 | " recovery action."); | ||
834 | module_param(dataserver_timeo, uint, 0644); | ||
835 | MODULE_PARM_DESC(dataserver_timeo, "The time (in tenths of a second) the " | ||
836 | "NFSv4.1 client waits for a response from a " | ||
837 | " data server before it retries an NFS request."); | ||