summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorAshish Pandey <aspandey@redhat.com>2015-10-23 13:27:51 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2015-11-01 21:51:01 -0800
commit9a0e3a7ecc61e47a0780708f86efc0170b8a85db (patch)
tree5ef48a2d0b12eae572cbab8cc7680c5f2f682eaf /xlators
parente3b48d847492b831487a8539e3e726706959ac2f (diff)
cluster/ec: update version and size on good bricks
Problem: readdir/readdirp fops calls [f]xattrop with fop->good which contain only one brick for these operations. That causes xattrop to be failed as it requires at least "minimum" number of brick. Solution: Use lock->good_mask to call xattrop. lock->good_mask contain all the good locked bricks on which the previous write opearion was successfull. Change-Id: If1b500391aa6fca6bd863702e030957b694ab499 BUG: 1272404 Signed-off-by: Ashish Pandey <aspandey@redhat.com> Reviewed-on: http://review.gluster.org/12419 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Xavier Hernandez <xhernandez@datalab.es> Tested-by: Xavier Hernandez <xhernandez@datalab.es> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/12440 Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/cluster/ec/src/ec-common.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/xlators/cluster/ec/src/ec-common.c b/xlators/cluster/ec/src/ec-common.c
index 7f1c3c535fa..152611f876f 100644
--- a/xlators/cluster/ec/src/ec-common.c
+++ b/xlators/cluster/ec/src/ec-common.c
@@ -1625,11 +1625,11 @@ ec_update_size_version(ec_lock_link_t *link, uint64_t *version,
fop->frame->root->gid = 0;
if (link->lock->fd == NULL) {
- ec_xattrop(fop->frame, fop->xl, fop->good, EC_MINIMUM_MIN,
+ ec_xattrop(fop->frame, fop->xl, lock->good_mask, EC_MINIMUM_MIN,
ec_update_size_version_done, link, &link->lock->loc,
GF_XATTROP_ADD_ARRAY64, dict, NULL);
} else {
- ec_fxattrop(fop->frame, fop->xl, fop->good, EC_MINIMUM_MIN,
+ ec_fxattrop(fop->frame, fop->xl, lock->good_mask, EC_MINIMUM_MIN,
ec_update_size_version_done, link, link->lock->fd,
GF_XATTROP_ADD_ARRAY64, dict, NULL);
}
@@ -1820,14 +1820,6 @@ void ec_unlock(ec_fop_data_t *fop)
void ec_flush_size_version(ec_fop_data_t *fop)
{
GF_ASSERT(fop->lock_count == 1);
-
- /* In normal circumstances, ec_update_info() is called after having
- * executed a normal fop, and it uses fop->good to update only those bricks
- * that succeeded. In this case we haven't executed any fop, so fop->good
- * is 0. We use the current good mask of the lock itself to send the
- * updates.*/
- fop->good = fop->locks[0].lock->good_mask;
-
ec_update_info(&fop->locks[0]);
}