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>
#define AFSPATHMAX 1024 /* Maximum length of a pathname plus NUL */
#define AFSOPAQUEMAX 1024 /* Maximum length of an opaque field */
#define AFSPATHMAX 1024 /* Maximum length of a pathname plus NUL */
#define AFSOPAQUEMAX 1024 /* Maximum length of an opaque field */
+#define AFS_VL_MAX_LIFESPAN (120 * HZ)
+#define AFS_PROBE_MAX_LIFESPAN (30 * HZ)
+
typedef u64 afs_volid_t;
typedef u64 afs_vnodeid_t;
typedef u64 afs_dataversion_t;
typedef u64 afs_volid_t;
typedef u64 afs_vnodeid_t;
typedef u64 afs_dataversion_t;
call->upgrade = true;
call->want_reply_time = true;
call->async = true;
call->upgrade = true;
call->want_reply_time = true;
call->async = true;
+ call->max_lifespan = AFS_PROBE_MAX_LIFESPAN;
/* marshall the parameters */
bp = call->request;
/* marshall the parameters */
bp = call->request;
int error; /* error code */
u32 abort_code; /* Remote abort ID or 0 */
u32 epoch;
int error; /* error code */
u32 abort_code; /* Remote abort ID or 0 */
u32 epoch;
+ unsigned int max_lifespan; /* Maximum lifespan to set if not 0 */
unsigned request_size; /* size of request data */
unsigned reply_max; /* maximum size of reply */
unsigned first_offset; /* offset into mapping[first] */
unsigned request_size; /* size of request data */
unsigned reply_max; /* maximum size of reply */
unsigned first_offset; /* offset into mapping[first] */
+ if (call->max_lifespan)
+ rxrpc_kernel_set_max_life(call->net->socket, rxcall,
+ call->max_lifespan);
+
/* send the request */
iov[0].iov_base = call->request;
iov[0].iov_len = call->request_size;
/* send the request */
iov[0].iov_base = call->request;
iov[0].iov_len = call->request_size;
call->key = vc->key;
call->reply[0] = entry;
call->ret_reply0 = true;
call->key = vc->key;
call->reply[0] = entry;
call->ret_reply0 = true;
+ call->max_lifespan = AFS_VL_MAX_LIFESPAN;
/* Marshall the parameters */
bp = call->request;
/* Marshall the parameters */
bp = call->request;
call->key = vc->key;
call->reply[0] = NULL;
call->ret_reply0 = true;
call->key = vc->key;
call->reply[0] = NULL;
call->ret_reply0 = true;
+ call->max_lifespan = AFS_VL_MAX_LIFESPAN;
/* Marshall the parameters */
bp = call->request;
/* Marshall the parameters */
bp = call->request;
call->upgrade = true;
call->want_reply_time = true;
call->async = true;
call->upgrade = true;
call->want_reply_time = true;
call->async = true;
+ call->max_lifespan = AFS_PROBE_MAX_LIFESPAN;
/* marshall the parameters */
bp = call->request;
/* marshall the parameters */
bp = call->request;
call->key = vc->key;
call->reply[0] = NULL;
call->ret_reply0 = true;
call->key = vc->key;
call->reply[0] = NULL;
call->ret_reply0 = true;
+ call->max_lifespan = AFS_VL_MAX_LIFESPAN;
/* Marshall the parameters */
bp = call->request;
/* Marshall the parameters */
bp = call->request;