From 4c1b66720121ca97ccfac3e09f93519f2f07ddfd Mon Sep 17 00:00:00 2001 From: Ravishankar N Date: Thu, 24 Dec 2015 15:22:05 +0530 Subject: afr: Fix excessive logging in afr_accuse_smallfiles() Commit 2b7226f9d3470d8fe4c98c1fddb06e7f641e364d did not check for the validity of a dict before doing a dict_get. Fix that. Change-Id: Ie21f4da19256b17196f242cd8fd5bb76b0a69c1e BUG: 1294053 Signed-off-by: Ravishankar N Reviewed-on: http://review.gluster.org/13077 Tested-by: NetBSD Build System Tested-by: Gluster Build System Reviewed-by: Pranith Kumar Karampuri --- xlators/cluster/afr/src/afr-common.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c index e6b43447abd..9be3670d380 100644 --- a/xlators/cluster/afr/src/afr-common.c +++ b/xlators/cluster/afr/src/afr-common.c @@ -637,7 +637,8 @@ afr_accuse_smallfiles (xlator_t *this, struct afr_reply *replies, priv = this->private; for (i = 0; i < priv->child_count; i++) { - if (dict_get (replies[i].xdata, GLUSTERFS_BAD_INODE)) + if (replies[i].valid && replies[i].xdata && + dict_get (replies[i].xdata, GLUSTERFS_BAD_INODE)) continue; if (data_accused[i]) continue; -- cgit