From 871bfc1c1418290c30484015f11a8c476489ca2a Mon Sep 17 00:00:00 2001 From: Anuradha Talur Date: Tue, 8 Dec 2015 17:02:23 +0530 Subject: features/index : Prevent logging due to NULL dict Backport of http://review.gluster.org/12910 Added a check for non-NULLness of dict before performing dict_foreach_match on it. Change-Id: I77d83559934006425ed33745b8a244b2f5d90cb1 BUG: 1287531 Signed-off-by: Anuradha Talur Reviewed-on: http://review.gluster.org/12910 Tested-by: NetBSD Build System Tested-by: Gluster Build System Reviewed-by: Pranith Kumar Karampuri Reviewed-on: http://review.gluster.org/12971 --- xlators/features/index/src/index.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'xlators/features/index') diff --git a/xlators/features/index/src/index.c b/xlators/features/index/src/index.c index 8cdb5feb870..482292a00f9 100644 --- a/xlators/features/index/src/index.c +++ b/xlators/features/index/src/index.c @@ -614,11 +614,11 @@ index_find_xattr_type (dict_t *d, char *k, data_t *v) int idx = -1; index_priv_t *priv = THIS->private; - if (is_xattr_in_watchlist (d, k, v, - priv->dirty_watchlist)) + if (priv->dirty_watchlist && is_xattr_in_watchlist (d, k, v, + priv->dirty_watchlist)) idx = DIRTY; - else if (is_xattr_in_watchlist (d, k, v, - priv->pending_watchlist)) + else if (priv->pending_watchlist && is_xattr_in_watchlist (d, k, v, + priv->pending_watchlist)) idx = PENDING; return idx; -- cgit