256ebe
From 9b94397a5a735910fab2a29670146a1feb6d890e Mon Sep 17 00:00:00 2001
256ebe
From: Mohammed Rafi KC <rkavunga@redhat.com>
256ebe
Date: Tue, 4 Jun 2019 11:13:50 +0530
256ebe
Subject: [PATCH 174/178] xlator/log: Add more logging in
256ebe
 xlator_is_cleanup_starting
256ebe
256ebe
This patch will add two extra logs for invalid argument
256ebe
256ebe
> upstream patch : https://review.gluster.org/#/c/glusterfs/+/22810/
256ebe
256ebe
>Change-Id: I3950b4f4b9d88b1f1e788ef93d8f09d4bd8d4d8b
256ebe
>updates: bz#1703948
256ebe
>Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
256ebe
256ebe
Change-Id: I3950b4f4b9d88b1f1e788ef93d8f09d4bd8d4d8b
256ebe
BUG: 1703434
256ebe
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
256ebe
Reviewed-on: https://code.engineering.redhat.com/gerrit/172800
256ebe
Tested-by: RHGS Build Bot <nigelb@redhat.com>
256ebe
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
256ebe
---
256ebe
 libglusterfs/src/xlator.c | 12 +++++++++---
256ebe
 1 file changed, 9 insertions(+), 3 deletions(-)
256ebe
256ebe
diff --git a/libglusterfs/src/xlator.c b/libglusterfs/src/xlator.c
256ebe
index fbfbbe2..71e1ed4 100644
256ebe
--- a/libglusterfs/src/xlator.c
256ebe
+++ b/libglusterfs/src/xlator.c
256ebe
@@ -1494,12 +1494,18 @@ xlator_is_cleanup_starting(xlator_t *this)
256ebe
     glusterfs_graph_t *graph = NULL;
256ebe
     xlator_t *xl = NULL;
256ebe
 
256ebe
-    if (!this)
256ebe
+    if (!this) {
256ebe
+        gf_msg("xlator", GF_LOG_WARNING, EINVAL, LG_MSG_INVALID_ARG,
256ebe
+               "xlator object is null, returning false");
256ebe
         goto out;
256ebe
-    graph = this->graph;
256ebe
+    }
256ebe
 
256ebe
-    if (!graph)
256ebe
+    graph = this->graph;
256ebe
+    if (!graph) {
256ebe
+        gf_msg("xlator", GF_LOG_WARNING, EINVAL, LG_MSG_INVALID_ARG,
256ebe
+               "Graph is not set for xlator %s", this->name);
256ebe
         goto out;
256ebe
+    }
256ebe
 
256ebe
     xl = graph->first;
256ebe
     if (xl && xl->cleanup_starting)
256ebe
-- 
256ebe
1.8.3.1
256ebe