From 7298b622ab39c2e78d6d745ae8b6e8413e1d9f1a Mon Sep 17 00:00:00 2001 From: Xavier Hernandez Date: Wed, 5 Aug 2015 23:42:41 +0200 Subject: cluster/ec: Fix tracking of good bricks The bitmask of good and bad bricks was kept in the context of the corresponding inode or fd. This was problematic when an external process (another client or the self-heal process) did heal the bricks but no one changed the bitmaks of other clients. This patch removes the bitmask stored in the context and calculates which bricks are healthy after locking them and doing the initial xattrop. After that, it's updated using the result of each fop. Change-Id: I225e31cd219a12af4ca58871d8a4bb6f742b223c BUG: 1236065 Signed-off-by: Xavier Hernandez Reviewed-on: http://review.gluster.org/11844 Tested-by: NetBSD Build System Tested-by: Gluster Build System Reviewed-by: Pranith Kumar Karampuri --- xlators/cluster/ec/src/ec-heal.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'xlators/cluster/ec/src/ec-heal.c') diff --git a/xlators/cluster/ec/src/ec-heal.c b/xlators/cluster/ec/src/ec-heal.c index f025cab9dfb..d095aceec00 100644 --- a/xlators/cluster/ec/src/ec-heal.c +++ b/xlators/cluster/ec/src/ec-heal.c @@ -292,8 +292,8 @@ void ec_fheal(call_frame_t * frame, xlator_t * this, uintptr_t target, if (ctx != NULL) { - gf_msg_trace ("ec", 0, "FHEAL ctx: flags=%X, open=%lX, bad=%lX", - ctx->flags, ctx->open, ctx->bad); + gf_msg_trace ("ec", 0, "FHEAL ctx: flags=%X, open=%lX", ctx->flags, + ctx->open); ec_heal(frame, this, target, minimum, func, data, &ctx->loc, partial, xdata); } @@ -1751,8 +1751,7 @@ ec_heal_block (call_frame_t *frame, xlator_t *this, uintptr_t target, VALIDATE_OR_GOTO(this, out); GF_VALIDATE_OR_GOTO(this->name, this->private, out); - fop = ec_fop_data_allocate (frame, this, EC_FOP_HEAL, - EC_FLAG_UPDATE_LOC_INODE, target, minimum, + fop = ec_fop_data_allocate (frame, this, EC_FOP_HEAL, 0, target, minimum, NULL, ec_manager_heal_block, callback, heal); if (fop == NULL) @@ -2444,8 +2443,7 @@ ec_heal (call_frame_t *frame, xlator_t *this, uintptr_t target, if (frame && frame->local) goto fail; - fop = ec_fop_data_allocate (frame, this, EC_FOP_HEAL, - EC_FLAG_UPDATE_LOC_INODE, target, minimum, + fop = ec_fop_data_allocate (frame, this, EC_FOP_HEAL, 0, target, minimum, NULL, NULL, callback, data); err = ENOMEM; -- cgit