From dd80e9e33bc42d11c6cba375bca2ee9a2db9776c Mon Sep 17 00:00:00 2001 From: Pranith Kumar Date: Thu, 2 Nov 2017 16:19:17 +0530 Subject: features/index: initialize the options properly watchlists should not over-write values gathered in previous invocation. Change-Id: I5634930d20e720ad6509b03a64360d7320800565 Signed-off-by: Amar Tumballi --- xlators/features/index/src/index.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/xlators/features/index/src/index.c b/xlators/features/index/src/index.c index 12f98974fc..619de37c13 100644 --- a/xlators/features/index/src/index.c +++ b/xlators/features/index/src/index.c @@ -2239,15 +2239,24 @@ index_make_xattrop_watchlist (xlator_t *this, index_priv_t *priv, switch (type) { case DIRTY: - priv->dirty_watchlist = xattrs; + priv->dirty_watchlist = dict_copy_with_ref (xattrs, + priv->dirty_watchlist); + if (!priv->dirty_watchlist) { + ret = -1; + goto out; + } break; case XATTROP: - priv->pending_watchlist = xattrs; + priv->pending_watchlist = dict_copy_with_ref (xattrs, + priv->pending_watchlist); + if (!priv->pending_watchlist) { + ret = -1; + goto out; + } break; default: break; } - xattrs = NULL; ret = 0; out: -- cgit