From 55c22fbfae259bff3b0e0cca192f709b74d8bee5 Mon Sep 17 00:00:00 2001 From: Mohammed Junaid Date: Mon, 19 Mar 2012 21:07:33 +0530 Subject: protocol/client: Handle failures in lock self healing gracefully (part 1). During reopening of fd's and reacquiring of locks on the fd (after a reconnect), a release on a fd on which reacquiring of locks is in progress will free up fdctx. This patch will keep fdctx valid until the reacquiring of locks is in progress. Change-Id: I0464c751a5aa986abac0b72b48b261fceeba24e8 BUG: 795386 Signed-off-by: Mohammed Junaid Reviewed-on: http://review.gluster.com/2937 Tested-by: Gluster Build System Reviewed-by: Amar Tumballi Reviewed-by: Vijay Bellur --- xlators/protocol/client/src/client.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'xlators/protocol/client/src/client.h') diff --git a/xlators/protocol/client/src/client.h b/xlators/protocol/client/src/client.h index 352d2b371..91a411e8a 100644 --- a/xlators/protocol/client/src/client.h +++ b/xlators/protocol/client/src/client.h @@ -38,6 +38,11 @@ #define GF_MAX_SOCKET_WINDOW_SIZE (1 * GF_UNIT_MB) #define GF_MIN_SOCKET_WINDOW_SIZE (0) +typedef enum { + GF_LK_HEAL_IN_PROGRESS, + GF_LK_HEAL_DONE, +} lk_heal_state_t; + #define CLIENT_GET_REMOTE_FD(conf, fd, remote_fd, op_errno, label) \ do { \ clnt_fd_ctx_t *fdctx = NULL; \ @@ -129,6 +134,7 @@ typedef struct _client_fd_ctx { int32_t wbflags; fd_lk_ctx_t *lk_ctx; pthread_mutex_t mutex; + lk_heal_state_t lk_heal_state; struct list_head lock_list; /* List of all granted locks on this fd */ } clnt_fd_ctx_t; -- cgit