Blob Blame History Raw
From 62b06c684239586e020b619f91e1867a60a1ea6e Mon Sep 17 00:00:00 2001
From: Pranith Kumar K <pkarampu@redhat.com>
Date: Fri, 11 Nov 2016 15:32:34 +0530
Subject: [PATCH 158/162] Revert "rpc: Fix the race between notification and reconnection"

This reverts commit 6d6ec6231b2064653725516ee3afa12a0a28f035.

BUG: 1385605
Change-Id: I7d1b9ba261cdcf72072d256ec2d5cb7216104d25
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: https://code.engineering.redhat.com/gerrit/89793
---
 rpc/rpc-lib/src/rpc-clnt.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/rpc/rpc-lib/src/rpc-clnt.c b/rpc/rpc-lib/src/rpc-clnt.c
index d946cfc..a9e43eb 100644
--- a/rpc/rpc-lib/src/rpc-clnt.c
+++ b/rpc/rpc-lib/src/rpc-clnt.c
@@ -899,10 +899,6 @@ rpc_clnt_notify (rpc_transport_t *trans, void *mydata,
         switch (event) {
         case RPC_TRANSPORT_DISCONNECT:
         {
-                if (clnt->notifyfn)
-                        ret = clnt->notifyfn (clnt, clnt->mydata,
-                                              RPC_CLNT_DISCONNECT, NULL);
-
                 rpc_clnt_connection_cleanup (conn);
 
                 pthread_mutex_lock (&conn->lock);
@@ -926,6 +922,9 @@ rpc_clnt_notify (rpc_transport_t *trans, void *mydata,
                 }
                 pthread_mutex_unlock (&conn->lock);
 
+                if (clnt->notifyfn)
+                        ret = clnt->notifyfn (clnt, clnt->mydata,
+                                              RPC_CLNT_DISCONNECT, NULL);
                 if (unref_clnt)
                         rpc_clnt_ref (clnt);
 
-- 
1.7.1