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