summaryrefslogtreecommitdiffstats
path: root/xlators/cluster
diff options
context:
space:
mode:
authorSakshi <sabansal@redhat.com>2015-06-05 13:48:09 +0530
committerRaghavendra G <rgowdapp@redhat.com>2015-06-19 03:47:00 -0700
commitc791765bc84b1ba62203b2b9c1e815944a39921c (patch)
tree2b1a33c0f065b28725e9d22c5a4bfbba3cf9e597 /xlators/cluster
parent8ddf7f2669779cee460f1e008cdb62671cf15a40 (diff)
dht : Error value check before performing rebalance complete
Change-Id: I7a0cd288d16f27b887c7820162efdbe99a039d95 BUG: 1188242 Signed-off-by: Sakshi <sabansal@redhat.com> Reviewed-on: http://review.gluster.org/11097 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: N Balachandran <nbalacha@redhat.com> Reviewed-by: Susant Palai <spalai@redhat.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'xlators/cluster')
-rw-r--r--xlators/cluster/dht/src/dht-inode-write.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/xlators/cluster/dht/src/dht-inode-write.c b/xlators/cluster/dht/src/dht-inode-write.c
index ec4029e5bd5..985fdeb5458 100644
--- a/xlators/cluster/dht/src/dht-inode-write.c
+++ b/xlators/cluster/dht/src/dht-inode-write.c
@@ -24,21 +24,29 @@ dht_writev_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
struct iatt *postbuf, dict_t *xdata)
{
dht_local_t *local = NULL;
+ call_frame_t *prev = NULL;
int ret = -1;
xlator_t *subvol1 = NULL;
xlator_t *subvol2 = NULL;
- if (op_ret == -1 && !dht_inode_missing(op_errno)) {
- goto out;
- }
-
local = frame->local;
+ prev = cookie;
+
if (!local) {
op_ret = -1;
op_errno = EINVAL;
goto out;
}
+ if (op_ret == -1 && !dht_inode_missing(op_errno)) {
+ local->op_errno = op_errno;
+ local->op_ret = -1;
+ gf_msg_debug (this->name, 0,
+ "subvolume %s returned -1 (%s)",
+ prev->this->name, strerror (op_errno));
+ goto out;
+ }
+
if (local->call_cnt != 1) {
/* preserve the modes of source */
if (local->stbuf.ia_blocks) {
@@ -52,7 +60,7 @@ dht_writev_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
local->op_errno = op_errno;
/* Phase 2 of migration */
- if (IS_DHT_MIGRATION_PHASE2 (postbuf)) {
+ if ((op_ret == -1) || IS_DHT_MIGRATION_PHASE2 (postbuf)) {
ret = dht_rebalance_complete_check (this, frame);
if (!ret)
return 0;