aboutsummaryrefslogtreecommitdiffstats
path: root/fs/afs
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2019-05-16 08:21:59 -0400
committerDavid Howells <dhowells@redhat.com>2019-05-16 11:25:20 -0400
commit94f699c9cdb11b8f53cb70624b69aeae16f26db2 (patch)
treef528d331b014f7914518024fb536108ab905cce2 /fs/afs
parentbbd172e31696709b58eb492fafb574985b778326 (diff)
afs: Fix the maximum lifespan of VL and probe calls
If an older AFS server doesn't support an operation, it may accept the call and then sit on it forever, happily responding to pings that make kafs think that the call is still alive. Fix this by setting the maximum lifespan of Volume Location service calls in particular and probe calls in general so that they don't run on endlessly if they're not supported. Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'fs/afs')
-rw-r--r--fs/afs/afs.h3
-rw-r--r--fs/afs/fsclient.c1
-rw-r--r--fs/afs/internal.h1
-rw-r--r--fs/afs/rxrpc.c4
-rw-r--r--fs/afs/vlclient.c4
5 files changed, 13 insertions, 0 deletions
diff --git a/fs/afs/afs.h b/fs/afs/afs.h
index d12ffb457e47..74913c707bba 100644
--- a/fs/afs/afs.h
+++ b/fs/afs/afs.h
@@ -23,6 +23,9 @@
23#define AFSPATHMAX 1024 /* Maximum length of a pathname plus NUL */ 23#define AFSPATHMAX 1024 /* Maximum length of a pathname plus NUL */
24#define AFSOPAQUEMAX 1024 /* Maximum length of an opaque field */ 24#define AFSOPAQUEMAX 1024 /* Maximum length of an opaque field */
25 25
26#define AFS_VL_MAX_LIFESPAN (120 * HZ)
27#define AFS_PROBE_MAX_LIFESPAN (30 * HZ)
28
26typedef u64 afs_volid_t; 29typedef u64 afs_volid_t;
27typedef u64 afs_vnodeid_t; 30typedef u64 afs_vnodeid_t;
28typedef u64 afs_dataversion_t; 31typedef u64 afs_dataversion_t;
diff --git a/fs/afs/fsclient.c b/fs/afs/fsclient.c
index 1296f5dc4c1e..7051b58d8a55 100644
--- a/fs/afs/fsclient.c
+++ b/fs/afs/fsclient.c
@@ -2115,6 +2115,7 @@ struct afs_call *afs_fs_get_capabilities(struct afs_net *net,
2115 call->upgrade = true; 2115 call->upgrade = true;
2116 call->want_reply_time = true; 2116 call->want_reply_time = true;
2117 call->async = true; 2117 call->async = true;
2118 call->max_lifespan = AFS_PROBE_MAX_LIFESPAN;
2118 2119
2119 /* marshall the parameters */ 2120 /* marshall the parameters */
2120 bp = call->request; 2121 bp = call->request;
diff --git a/fs/afs/internal.h b/fs/afs/internal.h
index 50d925f0a556..4765c6716242 100644
--- a/fs/afs/internal.h
+++ b/fs/afs/internal.h
@@ -131,6 +131,7 @@ struct afs_call {
131 int error; /* error code */ 131 int error; /* error code */
132 u32 abort_code; /* Remote abort ID or 0 */ 132 u32 abort_code; /* Remote abort ID or 0 */
133 u32 epoch; 133 u32 epoch;
134 unsigned int max_lifespan; /* Maximum lifespan to set if not 0 */
134 unsigned request_size; /* size of request data */ 135 unsigned request_size; /* size of request data */
135 unsigned reply_max; /* maximum size of reply */ 136 unsigned reply_max; /* maximum size of reply */
136 unsigned first_offset; /* offset into mapping[first] */ 137 unsigned first_offset; /* offset into mapping[first] */
diff --git a/fs/afs/rxrpc.c b/fs/afs/rxrpc.c
index a34a89c75c6a..4974defb4592 100644
--- a/fs/afs/rxrpc.c
+++ b/fs/afs/rxrpc.c
@@ -426,6 +426,10 @@ void afs_make_call(struct afs_addr_cursor *ac, struct afs_call *call, gfp_t gfp)
426 426
427 call->rxcall = rxcall; 427 call->rxcall = rxcall;
428 428
429 if (call->max_lifespan)
430 rxrpc_kernel_set_max_life(call->net->socket, rxcall,
431 call->max_lifespan);
432
429 /* send the request */ 433 /* send the request */
430 iov[0].iov_base = call->request; 434 iov[0].iov_base = call->request;
431 iov[0].iov_len = call->request_size; 435 iov[0].iov_len = call->request_size;
diff --git a/fs/afs/vlclient.c b/fs/afs/vlclient.c
index dd9ba4e96fb3..7c53768a360b 100644
--- a/fs/afs/vlclient.c
+++ b/fs/afs/vlclient.c
@@ -157,6 +157,7 @@ struct afs_vldb_entry *afs_vl_get_entry_by_name_u(struct afs_vl_cursor *vc,
157 call->key = vc->key; 157 call->key = vc->key;
158 call->reply[0] = entry; 158 call->reply[0] = entry;
159 call->ret_reply0 = true; 159 call->ret_reply0 = true;
160 call->max_lifespan = AFS_VL_MAX_LIFESPAN;
160 161
161 /* Marshall the parameters */ 162 /* Marshall the parameters */
162 bp = call->request; 163 bp = call->request;
@@ -289,6 +290,7 @@ struct afs_addr_list *afs_vl_get_addrs_u(struct afs_vl_cursor *vc,
289 call->key = vc->key; 290 call->key = vc->key;
290 call->reply[0] = NULL; 291 call->reply[0] = NULL;
291 call->ret_reply0 = true; 292 call->ret_reply0 = true;
293 call->max_lifespan = AFS_VL_MAX_LIFESPAN;
292 294
293 /* Marshall the parameters */ 295 /* Marshall the parameters */
294 bp = call->request; 296 bp = call->request;
@@ -403,6 +405,7 @@ struct afs_call *afs_vl_get_capabilities(struct afs_net *net,
403 call->upgrade = true; 405 call->upgrade = true;
404 call->want_reply_time = true; 406 call->want_reply_time = true;
405 call->async = true; 407 call->async = true;
408 call->max_lifespan = AFS_PROBE_MAX_LIFESPAN;
406 409
407 /* marshall the parameters */ 410 /* marshall the parameters */
408 bp = call->request; 411 bp = call->request;
@@ -646,6 +649,7 @@ struct afs_addr_list *afs_yfsvl_get_endpoints(struct afs_vl_cursor *vc,
646 call->key = vc->key; 649 call->key = vc->key;
647 call->reply[0] = NULL; 650 call->reply[0] = NULL;
648 call->ret_reply0 = true; 651 call->ret_reply0 = true;
652 call->max_lifespan = AFS_VL_MAX_LIFESPAN;
649 653
650 /* Marshall the parameters */ 654 /* Marshall the parameters */
651 bp = call->request; 655 bp = call->request;