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