summaryrefslogtreecommitdiffstats
path: root/xlators/protocol
diff options
context:
space:
mode:
authorMohit Agrawal <moagrawa@redhat.com>2018-05-13 12:01:01 +0530
committerRaghavendra G <rgowdapp@redhat.com>2018-05-15 02:37:55 +0000
commit8e2289b1e76ac777b71897dc709d9651341bd241 (patch)
treeecea0e7df1aae603162032c355a010fc608d562a /xlators/protocol
parent829f32c61c364323bab494cf9dab880aad4be463 (diff)
glusterfs: Resolve brick crashes at the time of inode_unref
Problem: Sometimes brick process is getting crash at the time of calling inode_unref in fd_destroy Solution: Brick process is getting crash because inode is already free by xlator_mem_cleanup call by server_rpc_notify.To resolve the same move code specific to call transport_unref in last in free_state. BUG: 1577574 Change-Id: Ia517c230d68af4e929b6b753e4c374a26c39dc1a fixes: bz#1577574 Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
Diffstat (limited to 'xlators/protocol')
-rw-r--r--xlators/protocol/server/src/server-helpers.c15
-rw-r--r--xlators/protocol/server/src/server.c6
2 files changed, 14 insertions, 7 deletions
diff --git a/xlators/protocol/server/src/server-helpers.c b/xlators/protocol/server/src/server-helpers.c
index 84f99ad8945..702856da216 100644
--- a/xlators/protocol/server/src/server-helpers.c
+++ b/xlators/protocol/server/src/server-helpers.c
@@ -177,10 +177,6 @@ server_resolve_wipe (server_resolve_t *resolve)
void
free_state (server_state_t *state)
{
- if (state->xprt) {
- rpc_transport_unref (state->xprt);
- state->xprt = NULL;
- }
if (state->fd) {
fd_unref (state->fd);
state->fd = NULL;
@@ -223,6 +219,17 @@ free_state (server_state_t *state)
compound_args_cleanup (state->args);
+ /* Call rpc_trnasport_unref to avoid crashes at last after free
+ all resources because of server_rpc_notify (for transport destroy)
+ call's xlator_mem_cleanup if all xprt are destroyed that internally
+ call's inode_table_destroy.
+ */
+ if (state->xprt) {
+ rpc_transport_unref (state->xprt);
+ state->xprt = NULL;
+ }
+
+
GF_FREE (state);
}
diff --git a/xlators/protocol/server/src/server.c b/xlators/protocol/server/src/server.c
index 294b0de34e4..80ea3e68fbb 100644
--- a/xlators/protocol/server/src/server.c
+++ b/xlators/protocol/server/src/server.c
@@ -150,9 +150,6 @@ server_submit_reply (call_frame_t *frame, rpcsvc_request_t *req, void *arg,
ret = 0;
ret:
- if (state)
- free_state (state);
-
if (client)
gf_client_unref (client);
@@ -162,6 +159,9 @@ ret:
if (new_iobref)
iobref_unref (iobref);
+ if (state)
+ free_state (state);
+
return ret;
}