a3470f
From 0b61a3b9c948a55da0df51a64483dcb8bc3954ba Mon Sep 17 00:00:00 2001
a3470f
From: moagrawa <moagrawa@redhat.com>
a3470f
Date: Mon, 23 Apr 2018 15:12:19 +0530
a3470f
Subject: [PATCH 238/260] quota: Build is failed due to access rpc->refcount in
a3470f
 wrong way
a3470f
a3470f
Problem: Build is failed on centos due to access rpc-refcount
a3470f
         in wrong way in quota.c
a3470f
a3470f
Solution: Update quota.c to access rpc->refcount
a3470f
a3470f
BUG: 1570582
a3470f
Change-Id: I881617259f73a7b1430e0ea80adf11168356d41e
a3470f
Signed-off-by: moagrawa <moagrawa@redhat.com>
a3470f
Reviewed-on: https://code.engineering.redhat.com/gerrit/136505
a3470f
Tested-by: RHGS Build Bot <nigelb@redhat.com>
a3470f
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
a3470f
---
a3470f
 xlators/features/quota/src/quota.c | 4 +++-
a3470f
 1 file changed, 3 insertions(+), 1 deletion(-)
a3470f
a3470f
diff --git a/xlators/features/quota/src/quota.c b/xlators/features/quota/src/quota.c
a3470f
index c4817bc..3d68ffa 100644
a3470f
--- a/xlators/features/quota/src/quota.c
a3470f
+++ b/xlators/features/quota/src/quota.c
a3470f
@@ -5259,7 +5259,9 @@ fini (xlator_t *this)
a3470f
         priv->rpc_clnt = NULL;
a3470f
         this->private = NULL;
a3470f
         if (rpc) {
a3470f
-                cnt = GF_ATOMIC_GET (rpc->refcount);
a3470f
+                pthread_mutex_lock (&rpc->lock);
a3470f
+                cnt = rpc->refcount;
a3470f
+                pthread_mutex_unlock (&rpc->lock);
a3470f
                 for (i = 0; i < cnt; i++)
a3470f
                         rpc_clnt_unref (rpc);
a3470f
         }
a3470f
-- 
a3470f
1.8.3.1
a3470f