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-generic.c | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 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 c5ea11b1210..47118faa917 100644 --- a/xlators/cluster/ec/src/ec-generic.c +++ b/xlators/cluster/ec/src/ec-generic.c @@ -168,9 +168,9 @@ void ec_flush(call_frame_t * frame, xlator_t * this, uintptr_t target, GF_VALIDATE_OR_GOTO(this->name, frame, out); GF_VALIDATE_OR_GOTO(this->name, this->private, out); - fop = ec_fop_data_allocate(frame, this, GF_FOP_FLUSH, EC_FLAG_UPDATE_FD, - target, minimum, ec_wind_flush, - ec_manager_flush, callback, data); + fop = ec_fop_data_allocate(frame, this, GF_FOP_FLUSH, 0, target, minimum, + ec_wind_flush, ec_manager_flush, callback, + data); if (fop == NULL) { goto out; } @@ -393,9 +393,9 @@ void ec_fsync(call_frame_t * frame, xlator_t * this, uintptr_t target, GF_VALIDATE_OR_GOTO(this->name, frame, out); GF_VALIDATE_OR_GOTO(this->name, this->private, out); - fop = ec_fop_data_allocate(frame, this, GF_FOP_FSYNC, EC_FLAG_UPDATE_FD, - target, minimum, ec_wind_fsync, - ec_manager_fsync, callback, data); + fop = ec_fop_data_allocate(frame, this, GF_FOP_FSYNC, 0, target, minimum, + ec_wind_fsync, ec_manager_fsync, callback, + data); if (fop == NULL) { goto out; } @@ -584,9 +584,9 @@ void ec_fsyncdir(call_frame_t * frame, xlator_t * this, uintptr_t target, GF_VALIDATE_OR_GOTO(this->name, frame, out); GF_VALIDATE_OR_GOTO(this->name, this->private, out); - fop = ec_fop_data_allocate(frame, this, GF_FOP_FSYNCDIR, EC_FLAG_UPDATE_FD, - target, minimum, ec_wind_fsyncdir, - ec_manager_fsyncdir, callback, data); + fop = ec_fop_data_allocate(frame, this, GF_FOP_FSYNCDIR, 0, target, + minimum, ec_wind_fsyncdir, ec_manager_fsyncdir, + callback, data); if (fop == NULL) { goto out; } @@ -1326,8 +1326,7 @@ void ec_xattrop(call_frame_t * frame, xlator_t * this, uintptr_t target, GF_VALIDATE_OR_GOTO(this->name, frame, out); GF_VALIDATE_OR_GOTO(this->name, this->private, out); - fop = ec_fop_data_allocate(frame, this, GF_FOP_XATTROP, - EC_FLAG_UPDATE_LOC_INODE, target, minimum, + fop = ec_fop_data_allocate(frame, this, GF_FOP_XATTROP, 0, target, minimum, ec_wind_xattrop, ec_manager_xattrop, callback, data); if (fop == NULL) { @@ -1399,10 +1398,9 @@ void ec_fxattrop(call_frame_t * frame, xlator_t * this, uintptr_t target, GF_VALIDATE_OR_GOTO(this->name, frame, out); GF_VALIDATE_OR_GOTO(this->name, this->private, out); - fop = ec_fop_data_allocate(frame, this, GF_FOP_FXATTROP, - EC_FLAG_UPDATE_FD_INODE, target, minimum, - ec_wind_fxattrop, ec_manager_xattrop, callback, - data); + fop = ec_fop_data_allocate(frame, this, GF_FOP_FXATTROP, 0, target, + minimum, ec_wind_fxattrop, ec_manager_xattrop, + callback, data); if (fop == NULL) { goto out; } -- cgit