From b41cdeb638f9f9ec2fef13ec95c216faf52a9df9 Mon Sep 17 00:00:00 2001 From: Mohit Agrawal Date: Mon, 28 Jan 2019 21:28:45 +0530 Subject: core: heketi-cli is throwing error "target is busy" Problem: When rpc-transport-disconnect happens, server_connection_cleanup_flush_cbk() is supposed to call rpc_transport_unref() after open-files on that transport are flushed per transport.But open-fd-count is maintained in bound_xl->fd_count, which can be incremented/decremented cumulatively in server_connection_cleanup() by all transport disconnect paths. So instead of rpc_transport_unref() happening per transport, it ends up doing it only once after all the files on all the transports for the brick are flushed leading to rpc-leaks. Solution: To avoid races maintain fd_cnt at client instead of maintaining on brick Credits: Pranith Kumar Karampuri Change-Id: I6e8ea37a61f82d9aefb227c5b3ab57a7a36850e6 fixes: bz#1668190 Signed-off-by: Mohit Agrawal --- libglusterfs/src/glusterfs/client_t.h | 2 ++ libglusterfs/src/glusterfs/xlator.h | 3 --- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'libglusterfs/src/glusterfs') diff --git a/libglusterfs/src/glusterfs/client_t.h b/libglusterfs/src/glusterfs/client_t.h index 29f50daf03b..8ef3665a9c2 100644 --- a/libglusterfs/src/glusterfs/client_t.h +++ b/libglusterfs/src/glusterfs/client_t.h @@ -47,6 +47,8 @@ typedef struct _client { inode_t *subdir_inode; uuid_t subdir_gfid; int32_t opversion; + /* Variable to save fd_count for detach brick */ + gf_atomic_t fd_cnt; } client_t; #define GF_CLIENTCTX_INITIAL_SIZE 8 diff --git a/libglusterfs/src/glusterfs/xlator.h b/libglusterfs/src/glusterfs/xlator.h index 0c39f4bd3cc..7002657d0bc 100644 --- a/libglusterfs/src/glusterfs/xlator.h +++ b/libglusterfs/src/glusterfs/xlator.h @@ -856,9 +856,6 @@ struct _xlator { /* Flag to understand how this xlator is categorized */ gf_category_t category; - /* Variable to save fd_count for detach brick */ - gf_atomic_t fd_cnt; - /* Variable to save xprt associated for detach brick */ gf_atomic_t xprtrefcnt; -- cgit