summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/ec/src/ec-dir-read.c
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2015-06-07 10:24:08 +0530
committerVijay Bellur <vbellur@redhat.com>2015-06-08 22:09:20 -0700
commit31866a490edf5b92886accac67eddf78b291d710 (patch)
tree3129f4bbb6b33c751d082112f41e05c03d0e30d5 /xlators/cluster/ec/src/ec-dir-read.c
parent7ca78f7a6466a0f2ff19caff526f6560b5275f69 (diff)
cluster/ec: Prevent double unwind
Problem: 1) ec_access/ec_readlink_/ec_readdir[p] _cbks are trying to recover only from ENOTCONN. 2) When the fop succeeds it unwinds right away. But when its ec_fop_manager resumes, if the number of bricks that are up is less than ec->fragments, the the state machine will resume with -EC_STATE_REPORT which unwinds again. This will lead to crashes. Fix: - If fop fails retry on other subvols, as ESTALE/ENOENT/EBADFD etc are also recoverable. - unwind success/failure in _cbks Change-Id: I2cac3c2f9669a4e6160f1ff4abc39f0299303222 BUG: 1228952 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/11111 Reviewed-by: Xavier Hernandez <xhernandez@datalab.es> Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'xlators/cluster/ec/src/ec-dir-read.c')
-rw-r--r--xlators/cluster/ec/src/ec-dir-read.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/xlators/cluster/ec/src/ec-dir-read.c b/xlators/cluster/ec/src/ec-dir-read.c
index 354c63d3683..782187856fc 100644
--- a/xlators/cluster/ec/src/ec-dir-read.c
+++ b/xlators/cluster/ec/src/ec-dir-read.c
@@ -361,7 +361,7 @@ int32_t ec_readdir_cbk(call_frame_t * frame, void * cookie, xlator_t * this,
ec_adjust_readdir(fop->xl->private, idx, entries);
}
- if (!ec_dispatch_one_retry(fop, idx, op_ret, op_errno))
+ if (!ec_dispatch_one_retry(fop, idx, op_ret))
{
if (fop->cbks.readdir != NULL)
{
@@ -429,6 +429,8 @@ int32_t ec_manager_readdir(ec_fop_data_t * fop, int32_t state)
if (fop->offset != 0)
{
+ /* Non-zero offset is irrecoverable error as the offset may not be
+ * valid on other bricks*/
int32_t idx = -1;
idx = ec_deitransform (fop->xl, fop->offset);
@@ -448,7 +450,6 @@ int32_t ec_manager_readdir(ec_fop_data_t * fop, int32_t state)
return EC_STATE_REPORT;
case -EC_STATE_INIT:
- case -EC_STATE_REPORT:
if (fop->id == GF_FOP_READDIR)
{
if (fop->cbks.readdir != NULL)
@@ -467,6 +468,7 @@ int32_t ec_manager_readdir(ec_fop_data_t * fop, int32_t state)
}
case EC_STATE_REPORT:
+ case -EC_STATE_REPORT:
return EC_STATE_END;
default:
@@ -564,7 +566,7 @@ int32_t ec_readdirp_cbk(call_frame_t * frame, void * cookie, xlator_t * this,
ec_adjust_readdir(fop->xl->private, idx, entries);
}
- if (!ec_dispatch_one_retry(fop, idx, op_ret, op_errno))
+ if (!ec_dispatch_one_retry(fop, idx, op_ret))
{
if (fop->cbks.readdirp != NULL)
{