f338ef
From fb1d503791c874296afab0cd7be59b6865340d72 Mon Sep 17 00:00:00 2001
f338ef
From: Xavi Hernandez <jahernan@redhat.com>
f338ef
Date: Wed, 25 Sep 2019 11:56:35 +0200
f338ef
Subject: [PATCH 302/302] cluster/ec: prevent filling shd log with "table not
f338ef
 found" messages
f338ef
f338ef
When self-heal daemon receives an inodelk contention notification, it tries
f338ef
to locate the related inode using inode_find() and the inode table owned by
f338ef
top-most xlator, which in this case doesn't have any inode table. This causes
f338ef
many messages to be logged by inode_find() function because the inode table
f338ef
passed is NULL.
f338ef
f338ef
This patch prevents this by making sure the inode table is not NULL before
f338ef
calling inode_find().
f338ef
f338ef
Upstream patch:
f338ef
> Change-Id: I8d001bd180aaaf1521ba40a536b097fcf70c991f
f338ef
> Upstream patch link: https://review.gluster.org/c/glusterfs/+/23481
f338ef
> Fixes: bz#1755344
f338ef
> Signed-off-by: Xavi Hernandez <jahernan@redhat.com>
f338ef
f338ef
Change-Id: I8d001bd180aaaf1521ba40a536b097fcf70c991f
f338ef
BUG: 1754790
f338ef
Signed-off-by: Xavi Hernandez <jahernan@redhat.com>
f338ef
Reviewed-on: https://code.engineering.redhat.com/gerrit/182207
f338ef
Tested-by: RHGS Build Bot <nigelb@redhat.com>
f338ef
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
f338ef
---
f338ef
 xlators/cluster/ec/src/ec.c | 15 +++++++++++++--
f338ef
 1 file changed, 13 insertions(+), 2 deletions(-)
f338ef
f338ef
diff --git a/xlators/cluster/ec/src/ec.c b/xlators/cluster/ec/src/ec.c
f338ef
index 19094c4..3f31c74 100644
f338ef
--- a/xlators/cluster/ec/src/ec.c
f338ef
+++ b/xlators/cluster/ec/src/ec.c
f338ef
@@ -463,6 +463,7 @@ ec_upcall(ec_t *ec, struct gf_upcall *upcall)
f338ef
     struct gf_upcall_cache_invalidation *ci = NULL;
f338ef
     struct gf_upcall_inodelk_contention *lc = NULL;
f338ef
     inode_t *inode;
f338ef
+    inode_table_t *table;
f338ef
 
f338ef
     switch (upcall->event_type) {
f338ef
         case GF_UPCALL_CACHE_INVALIDATION:
f338ef
@@ -476,8 +477,18 @@ ec_upcall(ec_t *ec, struct gf_upcall *upcall)
f338ef
                 /* The lock is not owned by EC, ignore it. */
f338ef
                 return _gf_true;
f338ef
             }
f338ef
-            inode = inode_find(((xlator_t *)ec->xl->graph->top)->itable,
f338ef
-                               upcall->gfid);
f338ef
+            table = ((xlator_t *)ec->xl->graph->top)->itable;
f338ef
+            if (table == NULL) {
f338ef
+                /* Self-heal daemon doesn't have an inode table on the top
f338ef
+                 * xlator because it doesn't need it. In this case we should
f338ef
+                 * use the inode table managed by EC itself where all inodes
f338ef
+                 * being healed should be present. However self-heal doesn't
f338ef
+                 * use eager-locking and inodelk's are already released as
f338ef
+                 * soon as possible. In this case we can safely ignore these
f338ef
+                 * notifications. */
f338ef
+                return _gf_false;
f338ef
+            }
f338ef
+            inode = inode_find(table, upcall->gfid);
f338ef
             /* If inode is not found, it means that it's already released,
f338ef
              * so we can ignore it. Probably it has been released and
f338ef
              * destroyed while the contention notification was being sent.
f338ef
-- 
f338ef
1.8.3.1
f338ef