summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2015-07-06 14:23:56 +0530
committerXavier Hernandez <xhernandez@datalab.es>2015-07-21 14:42:47 -0700
commit1a7d49cfecd75b97641ab9261ee3c930bd51e895 (patch)
treec9a9295c8e5a6a0b854066160f7ecb7569476749 /xlators
parent75c20274002982bade23179b3680025c0bce7af4 (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> BUG: 1243647 Change-Id: Ic8570710a16715322bc0be59367007567f6438cd Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/11682 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Xavier Hernandez <xhernandez@datalab.es>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/cluster/ec/src/ec-common.c41
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 455df99c80c..200aedaa5b1 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;