a3470f
From ef08094304905a40339fba306e64508082432ab3 Mon Sep 17 00:00:00 2001
a3470f
From: Mohit Agrawal <moagrawa@redhat.com>
a3470f
Date: Thu, 25 Jan 2018 10:03:09 +0530
a3470f
Subject: [PATCH 141/148] rpc: Showing some unusual timer error logs during
a3470f
 brick stop
a3470f
a3470f
Solution: Update msg condition in gf_timer_call_after function
a3470f
          to avoid the message
a3470f
a3470f
> BUG: 1538427
a3470f
> Change-Id: I849e8e052a8259cf977fd5e7ff3aeba52f9b5f27
a3470f
> Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
a3470f
> (Upstream patch link https://review.gluster.org/#/c/19320/)
a3470f
> (cherry picked from commit c142d26e44436d805e476f2d13ac8726052a59c4)
a3470f
a3470f
BUG: 1467536
a3470f
Change-Id: I849e8e052a8259cf977fd5e7ff3aeba52f9b5f27
a3470f
Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
a3470f
Reviewed-on: https://code.engineering.redhat.com/gerrit/129722
a3470f
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
a3470f
Tested-by: RHGS Build Bot <nigelb@redhat.com>
a3470f
---
a3470f
 libglusterfs/src/timer.c | 18 +++---------------
a3470f
 1 file changed, 3 insertions(+), 15 deletions(-)
a3470f
a3470f
diff --git a/libglusterfs/src/timer.c b/libglusterfs/src/timer.c
a3470f
index 3d69a9f..34dfd35 100644
a3470f
--- a/libglusterfs/src/timer.c
a3470f
+++ b/libglusterfs/src/timer.c
a3470f
@@ -30,10 +30,11 @@ gf_timer_call_after (glusterfs_ctx_t *ctx,
a3470f
         gf_timer_t *trav = NULL;
a3470f
         uint64_t at = 0;
a3470f
 
a3470f
-        if (ctx == NULL)
a3470f
+        if ((ctx == NULL) || (ctx->cleanup_started))
a3470f
         {
a3470f
                 gf_msg_callingfn ("timer", GF_LOG_ERROR, EINVAL,
a3470f
-                                  LG_MSG_INVALID_ARG, "invalid argument");
a3470f
+                                  LG_MSG_INVALID_ARG, "Either ctx is NULL or"
a3470f
+                                  " ctx cleanup started");
a3470f
                 return NULL;
a3470f
         }
a3470f
 
a3470f
@@ -186,19 +187,6 @@ gf_timer_registry_init (glusterfs_ctx_t *ctx)
a3470f
 {
a3470f
         gf_timer_registry_t *reg = NULL;
a3470f
 
a3470f
-        if (ctx == NULL) {
a3470f
-                gf_msg_callingfn ("timer", GF_LOG_ERROR, EINVAL,
a3470f
-                                  LG_MSG_INVALID_ARG, "invalid argument");
a3470f
-                return NULL;
a3470f
-        }
a3470f
-
a3470f
-        if (ctx->cleanup_started) {
a3470f
-                gf_msg_callingfn ("timer", GF_LOG_INFO, 0,
a3470f
-                                  LG_MSG_CTX_CLEANUP_STARTED,
a3470f
-                                  "ctx cleanup started");
a3470f
-                return NULL;
a3470f
-        }
a3470f
-
a3470f
         LOCK (&ctx->lock);
a3470f
         {
a3470f
                 reg = ctx->timer;
a3470f
-- 
a3470f
1.8.3.1
a3470f