summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSoumya Koduri <skoduri@redhat.com>2015-08-06 06:22:38 +0530
committerKaleb KEITHLEY <kkeithle@redhat.com>2015-08-08 03:50:24 -0700
commit6e8c137fb7deca75817d617d40ebd58bbcae186a (patch)
treeee78d4a13aeac6e0867e4144adb7804cbc96194b
parent1868be8a5c309da8d516624d4af3b3b97819a9eb (diff)
rpc-clnt: Check for transport object during rpc connection cleanup
While doing glfs_fini(), all the xlators are first notified of PARENT_DOWN. protocol-client xlator on receving that notification does rpc_clnt_disable which disassociates rpc->conn with its transport object and does socket shutdown. So any further references to conn->trans should not happen during rpc connection cleanup which is done mainly as part of epoll event handling of EPOLLERR/EPOLLHUP. BUG: 1250797 Change-Id: I7d0346451d40372ad59a6a2326176fbb1e694712 Signed-off-by: Soumya Koduri <skoduri@redhat.com> Reviewed-on: http://review.gluster.org/11845 Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
-rw-r--r--rpc/rpc-lib/src/rpc-clnt-ping.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/rpc/rpc-lib/src/rpc-clnt-ping.c b/rpc/rpc-lib/src/rpc-clnt-ping.c
index 64d319d0057..a7ff866ac99 100644
--- a/rpc/rpc-lib/src/rpc-clnt-ping.c
+++ b/rpc/rpc-lib/src/rpc-clnt-ping.c
@@ -84,9 +84,13 @@ rpc_clnt_remove_ping_timer_locked (struct rpc_clnt *rpc)
return 1;
}
- gf_log_callingfn ("", GF_LOG_DEBUG, "%s: ping timer event "
- "already removed",
- conn->trans->peerinfo.identifier);
+
+ /* This is to account for rpc_clnt_disable that might have set
+ * conn->trans to NULL. */
+ if (conn->trans)
+ gf_log_callingfn ("", GF_LOG_DEBUG, "%s: ping timer event "
+ "already removed",
+ conn->trans->peerinfo.identifier);
return 0;
}