a3470f
From 669cc980d642af5bac1d41e3671822321b6bc986 Mon Sep 17 00:00:00 2001
a3470f
From: Mohit Agrawal <moagrawa@redhat.com>
a3470f
Date: Tue, 29 May 2018 14:57:44 +0530
a3470f
Subject: [PATCH 295/305] dht: Excessive 'dict is null' logs in
a3470f
 dht_revalidate_cbk
a3470f
a3470f
Problem: In case of error(ESTALE/ENOENT) dht_revalidate_cbk
a3470f
         throws "dict is null" error because xattr is not available
a3470f
a3470f
Solution: To avoid the logs update condition in dht_revalidate_cbk
a3470f
          and dht_lookup_dir_cbk
a3470f
a3470f
> BUG: 1583565
a3470f
> Change-Id: Ife6b3eeb6d91bf24403ed3100e237bb5d15b4357
a3470f
> fixes: bz#1583565
a3470f
> (Cherry pick from commit 052fce3f31d856fce10e07eda5f5c49ad3390d3a)
a3470f
> (Upstream review link https://review.gluster.org/#/c/20096/)
a3470f
a3470f
BUG: 1581553
a3470f
Change-Id: Ib86e7a14f30b7357ebdffd42fe91ee295e152e64
a3470f
Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
a3470f
Reviewed-on: https://code.engineering.redhat.com/gerrit/140185
a3470f
Tested-by: RHGS Build Bot <nigelb@redhat.com>
a3470f
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
a3470f
---
a3470f
 xlators/cluster/dht/src/dht-common.c | 6 ++++--
a3470f
 1 file changed, 4 insertions(+), 2 deletions(-)
a3470f
a3470f
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c
a3470f
index feeaa3f..5f246b1 100644
a3470f
--- a/xlators/cluster/dht/src/dht-common.c
a3470f
+++ b/xlators/cluster/dht/src/dht-common.c
a3470f
@@ -1499,7 +1499,8 @@ unlock:
a3470f
                 DHT_STRIP_PHASE1_FLAGS (&local->stbuf);
a3470f
                 dht_set_fixed_dir_stat (&local->postparent);
a3470f
                 /* Delete mds xattr at the time of STACK UNWIND */
a3470f
-                GF_REMOVE_INTERNAL_XATTR (conf->mds_xattr_key, local->xattr);
a3470f
+                if (local->xattr)
a3470f
+                        GF_REMOVE_INTERNAL_XATTR (conf->mds_xattr_key, local->xattr);
a3470f
                 DHT_STACK_UNWIND (lookup, frame, local->op_ret, local->op_errno,
a3470f
                                   local->inode, &local->stbuf, local->xattr,
a3470f
                                   &local->postparent);
a3470f
@@ -1902,7 +1903,8 @@ cont:
a3470f
                         local->op_errno = ESTALE;
a3470f
                 }
a3470f
                 /* Delete mds xattr at the time of STACK UNWIND */
a3470f
-                GF_REMOVE_INTERNAL_XATTR (conf->mds_xattr_key, local->xattr);
a3470f
+                if (local->xattr)
a3470f
+                        GF_REMOVE_INTERNAL_XATTR (conf->mds_xattr_key, local->xattr);
a3470f
 
a3470f
                 DHT_STACK_UNWIND (lookup, frame, local->op_ret, local->op_errno,
a3470f
                                   local->inode, &local->stbuf, local->xattr,
a3470f
-- 
a3470f
1.8.3.1
a3470f