summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/ec/src/ec-dir-write.c
diff options
context:
space:
mode:
authorAshish Pandey <aspandey@redhat.com>2016-06-09 16:19:37 +0530
committerXavier Hernandez <xhernandez@datalab.es>2016-06-10 02:14:37 -0700
commita837357c5c7873bf19155e76bf6c251fa799a605 (patch)
treedfcb2df56d748c971d9abd1e98bf67750bfcb5ea /xlators/cluster/ec/src/ec-dir-write.c
parent5016cc548d4368b1c180459d6fa8ae012bb21d6e (diff)
cluster/ec: Pass xdata to dht in case of error
Problem: In case of mkdir failure, dht expects error information so that it can act accordingly. Aftre adding bricks and re balance, layout gets changed. Fop "mkdir" with old layout returns EIO. EC gets this error in xdata but does not pass it back to dht. In this case dht will not be able to take corrective action. Solution: Return xdata back to dht Change-Id: I24def8038e6880607689b7b046dc6428f564c6ab BUG: 1344277 Signed-off-by: Ashish Pandey <aspandey@redhat.com> Reviewed-on: http://review.gluster.org/14679 Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Reviewed-by: Xavier Hernandez <xhernandez@datalab.es> Tested-by: Atin Mukherjee <amukherj@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Diffstat (limited to 'xlators/cluster/ec/src/ec-dir-write.c')
-rw-r--r--xlators/cluster/ec/src/ec-dir-write.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/xlators/cluster/ec/src/ec-dir-write.c b/xlators/cluster/ec/src/ec-dir-write.c
index 68741137619..e181170650d 100644
--- a/xlators/cluster/ec/src/ec-dir-write.c
+++ b/xlators/cluster/ec/src/ec-dir-write.c
@@ -46,12 +46,12 @@ ec_dir_write_cbk (call_frame_t *frame, xlator_t *this,
if (!cbk)
goto out;
- if (op_ret < 0)
- goto out;
-
if (xdata)
cbk->xdata = dict_ref (xdata);
+ if (op_ret < 0)
+ goto out;
+
if (poststat)
cbk->iatt[i++] = *poststat;
@@ -584,12 +584,14 @@ int32_t ec_manager_mkdir(ec_fop_data_t * fop, int32_t state)
case -EC_STATE_DISPATCH:
case -EC_STATE_PREPARE_ANSWER:
case -EC_STATE_REPORT:
+ cbk = fop->answer;
GF_ASSERT(fop->error != 0);
if (fop->cbks.mkdir != NULL)
{
fop->cbks.mkdir(fop->req_frame, fop, fop->xl, -1, fop->error,
- NULL, NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL, NULL,
+ ((cbk) ? cbk->xdata : NULL));
}
return EC_STATE_LOCK_REUSE;