12a457
From 7f92b639288a7521ec9694df332d935f712c6a6b Mon Sep 17 00:00:00 2001
12a457
From: Ashish Pandey <aspandey@redhat.com>
12a457
Date: Thu, 9 Jun 2016 16:19:37 +0530
12a457
Subject: [PATCH 195/195] cluster/ec: Pass xdata to dht in case of error
12a457
12a457
Problem: In case of mkdir failure, dht expects
12a457
error information so that it can act accordingly.
12a457
Aftre adding bricks and re balance, layout gets
12a457
changed. Fop "mkdir" with old layout returns EIO.
12a457
EC gets this error in xdata but does not pass it
12a457
back to dht. In this case dht will not be able to
12a457
take corrective action.
12a457
12a457
Solution: Return xdata back to dht
12a457
12a457
master -
12a457
http://review.gluster.org/#/c/14679/
12a457
release-3.7 -
12a457
http://review.gluster.org/#/c/14689/
12a457
release-3.8 -
12a457
http://review.gluster.org/#/c/14690/
12a457
12a457
Change-Id: I24def8038e6880607689b7b046dc6428f564c6ab
12a457
BUG: 1344278
12a457
Signed-off-by: Ashish Pandey <aspandey@redhat.com>
12a457
Reviewed-on: https://code.engineering.redhat.com/gerrit/76318
12a457
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
12a457
Tested-by: Atin Mukherjee <amukherj@redhat.com>
12a457
---
12a457
 xlators/cluster/ec/src/ec-dir-write.c |   10 ++++++----
12a457
 1 files changed, 6 insertions(+), 4 deletions(-)
12a457
12a457
diff --git a/xlators/cluster/ec/src/ec-dir-write.c b/xlators/cluster/ec/src/ec-dir-write.c
12a457
index 6874113..e181170 100644
12a457
--- a/xlators/cluster/ec/src/ec-dir-write.c
12a457
+++ b/xlators/cluster/ec/src/ec-dir-write.c
12a457
@@ -46,12 +46,12 @@ ec_dir_write_cbk (call_frame_t *frame, xlator_t *this,
12a457
         if (!cbk)
12a457
                 goto out;
12a457
 
12a457
-        if (op_ret < 0)
12a457
-                goto out;
12a457
-
12a457
         if (xdata)
12a457
                 cbk->xdata = dict_ref (xdata);
12a457
 
12a457
+        if (op_ret < 0)
12a457
+                goto out;
12a457
+
12a457
         if (poststat)
12a457
                 cbk->iatt[i++] = *poststat;
12a457
 
12a457
@@ -584,12 +584,14 @@ int32_t ec_manager_mkdir(ec_fop_data_t * fop, int32_t state)
12a457
         case -EC_STATE_DISPATCH:
12a457
         case -EC_STATE_PREPARE_ANSWER:
12a457
         case -EC_STATE_REPORT:
12a457
+            cbk = fop->answer;
12a457
             GF_ASSERT(fop->error != 0);
12a457
 
12a457
             if (fop->cbks.mkdir != NULL)
12a457
             {
12a457
                 fop->cbks.mkdir(fop->req_frame, fop, fop->xl, -1, fop->error,
12a457
-                                NULL, NULL, NULL, NULL, NULL);
12a457
+                                NULL, NULL, NULL, NULL,
12a457
+                                ((cbk) ? cbk->xdata : NULL));
12a457
             }
12a457
 
12a457
             return EC_STATE_LOCK_REUSE;
12a457
-- 
12a457
1.7.1
12a457