diff options
author | Pranith Kumar K <pkarampu@redhat.com> | 2015-07-06 14:23:56 +0530 |
---|---|---|
committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2015-07-06 16:54:31 -0700 |
commit | 87f512655f76e788a5a81c5de66ed55881cb5f82 (patch) | |
tree | 88ec8503def67c3ac0ff5faada6aa12b562c5840 | |
parent | 88a719648475a6bf8d83c69a3b63b3d8a9a338cb (diff) |
cluster/ec: Don't read from bad subvols
Change-Id: Ic22813371faca4e8198c9b0b20518e68d275f3c1
BUG: 1232678
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/11531
Reviewed-by: Xavier Hernandez <xhernandez@datalab.es>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
-rw-r--r-- | xlators/cluster/ec/src/ec-common.c | 41 |
1 files changed, 23 insertions, 18 deletions
diff --git a/xlators/cluster/ec/src/ec-common.c b/xlators/cluster/ec/src/ec-common.c index 414a872278d..8d1196dd0c3 100644 --- a/xlators/cluster/ec/src/ec-common.c +++ b/xlators/cluster/ec/src/ec-common.c @@ -382,6 +382,24 @@ void ec_complete(ec_fop_data_t * fop) ec_fop_data_release(fop); } +/* There could be already granted locks sitting on the bricks, unlock for which + * must be wound at all costs*/ +static gf_boolean_t +ec_must_wind (ec_fop_data_t *fop) +{ + if ((fop->id == GF_FOP_INODELK) || (fop->id == GF_FOP_FINODELK) || + (fop->id == GF_FOP_LK)) { + if (fop->flock.l_type == F_UNLCK) + return _gf_true; + } else if ((fop->id == GF_FOP_ENTRYLK) || + (fop->id == GF_FOP_FENTRYLK)) { + if (fop->entrylk_cmd == ENTRYLK_UNLOCK) + return _gf_true; + } + + return _gf_false; +} + int32_t ec_child_select(ec_fop_data_t * fop) { ec_t * ec = fop->xl->private; @@ -391,6 +409,11 @@ int32_t ec_child_select(ec_fop_data_t * fop) ec_fop_cleanup(fop); fop->mask &= ec->node_mask; + /* Wind the fop on same subvols as parent for any internal extra fops like + * head/tail read in case of writev fop. Unlocks shouldn't do this because + * unlock should go on all subvols where lock is performed*/ + if (fop->parent && !ec_must_wind (fop)) + fop->mask &= fop->parent->mask; mask = ec->xl_up; if (fop->parent == NULL) @@ -1868,24 +1891,6 @@ void ec_lock_reuse(ec_fop_data_t *fop) } } -/* There could be already granted locks sitting on the bricks, unlock for which - * must be wound at all costs*/ -static gf_boolean_t -ec_must_wind (ec_fop_data_t *fop) -{ - if ((fop->id == GF_FOP_INODELK) || (fop->id == GF_FOP_FINODELK) || - (fop->id == GF_FOP_LK)) { - if (fop->flock.l_type == F_UNLCK) - return _gf_true; - } else if ((fop->id == GF_FOP_ENTRYLK) || - (fop->id == GF_FOP_FENTRYLK)) { - if (fop->entrylk_cmd == ENTRYLK_UNLOCK) - return _gf_true; - } - - return _gf_false; -} - void __ec_manager(ec_fop_data_t * fop, int32_t error) { ec_t *ec = fop->xl->private; |