From a837357c5c7873bf19155e76bf6c251fa799a605 Mon Sep 17 00:00:00 2001 From: Ashish Pandey Date: Thu, 9 Jun 2016 16:19:37 +0530 Subject: 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 Reviewed-on: http://review.gluster.org/14679 Reviewed-by: Pranith Kumar Karampuri Reviewed-by: Xavier Hernandez Tested-by: Atin Mukherjee Smoke: Gluster Build System CentOS-regression: Gluster Build System NetBSD-regression: NetBSD Build System --- xlators/cluster/ec/src/ec-dir-write.c | 10 ++++++---- 1 file 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; -- cgit