From 02f9835d24aa07bd4e9fcb39cb7ace343f31924f Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Sun, 26 Apr 2015 14:28:00 +0530 Subject: cluster/ec: Change meaning of trusted.ec.dirty - With this change, the xattr will represent if the file needs to be healed or not. It will have different values for data/entry and metadata changes. - inode ref leaks and dict_set_dynstr related leaks fixed - Added support for trylock/lock based on heal-cmd execution or not in data heal. - Made fixes to pass regression runs Change-Id: I9d8def4c2badde18a76b7898816fecfac113737a BUG: 1215265 Signed-off-by: Pranith Kumar K Reviewed-on: http://review.gluster.org/10385 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/cluster/ec/src/ec-generic.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'xlators/cluster/ec/src/ec-generic.c') diff --git a/xlators/cluster/ec/src/ec-generic.c b/xlators/cluster/ec/src/ec-generic.c index 50169771476..d957bf6533d 100644 --- a/xlators/cluster/ec/src/ec-generic.c +++ b/xlators/cluster/ec/src/ec-generic.c @@ -759,7 +759,6 @@ void ec_lookup_rebuild(ec_t * ec, ec_fop_data_t * fop, ec_cbk_data_t * cbk) for (i = 0, ans = cbk; (ans != NULL) && (i < ec->fragments); ans = ans->next) { - if (!ans->dirty) { data = dict_get(ans->xdata, GF_CONTENT_KEY); if (data != NULL) { @@ -770,7 +769,6 @@ void ec_lookup_rebuild(ec_t * ec, ec_fop_data_t * fop, ec_cbk_data_t * cbk) } i++; } - } } if (i >= ec->fragments) @@ -878,8 +876,6 @@ int32_t ec_lookup_cbk(call_frame_t * frame, void * cookie, xlator_t * this, } if (xdata != NULL) { - uint64_t dirty; - cbk->xdata = dict_ref(xdata); if (cbk->xdata == NULL) { @@ -888,9 +884,8 @@ int32_t ec_lookup_cbk(call_frame_t * frame, void * cookie, xlator_t * this, goto out; } - if (ec_dict_del_number(cbk->xdata, EC_XATTR_DIRTY, &dirty) == 0) { - cbk->dirty = dirty != 0; - } + ec_dict_del_array (xdata, EC_XATTR_DIRTY, cbk->dirty, + EC_VERSION_SIZE); } ec_combine(cbk, ec_combine_lookup); @@ -1341,7 +1336,6 @@ ec_xattrop_cbk (call_frame_t *frame, void *cookie, xlator_t *this, goto out; if (op_ret >= 0) { - uint64_t dirty; cbk->dict = dict_ref (xattr); if (dict_get_bin (xattr, EC_XATTR_VERSION, @@ -1350,9 +1344,8 @@ ec_xattrop_cbk (call_frame_t *frame, void *cookie, xlator_t *this, if ((version >> EC_SELFHEAL_BIT) & 1) fop->healing |= (1ULL<dirty = dirty != 0; + ec_dict_del_array (xattr, EC_XATTR_DIRTY, cbk->dirty, + EC_VERSION_SIZE); } if (xdata) -- cgit