summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendrabhat@gluster.com>2010-09-21 08:12:36 +0000
committerVijay Bellur <vijay@dev.gluster.com>2010-09-21 10:41:22 -0700
commita2688982b7694f18d6a1d7e20ab36274cca9cc27 (patch)
treec75d2bcb717dff529d8464a21b8d108732b268a6
parent78a09306fe1bd955616b8dd56e85f3af954c96b0 (diff)
unmount the replace brick client irrespective of whether the previous commands succeeded or not after the mount
Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1661 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1661
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-op-sm.c41
1 files changed, 31 insertions, 10 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
index f32fc9c89..34439a697 100644
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
@@ -1928,6 +1928,9 @@ rb_do_operation_start (glusterd_volinfo_t *volinfo,
goto out;
}
+ gf_log ("", GF_LOG_DEBUG,
+ "mounted the replace brick client");
+
snprintf (start_value, 8192, "%s:%s:",
dst_brickinfo->hostname,
dst_brickinfo->path);
@@ -1939,7 +1942,6 @@ rb_do_operation_start (glusterd_volinfo_t *volinfo,
if (ret) {
gf_log ("", GF_LOG_DEBUG,
"Failed to send command to pump");
- goto out;
}
ret = rb_destroy_maintainence_client (volinfo, src_brickinfo);
@@ -1950,6 +1952,8 @@ rb_do_operation_start (glusterd_volinfo_t *volinfo,
goto out;
}
+ gf_log ("", GF_LOG_DEBUG,
+ "unmounted the replace brick client");
ret = 0;
out:
@@ -1974,13 +1978,16 @@ rb_do_operation_pause (glusterd_volinfo_t *volinfo,
goto out;
}
+ gf_log ("", GF_LOG_DEBUG,
+ "mounted the replace brick client");
+
ret = rb_send_xattr_command (volinfo, src_brickinfo,
dst_brickinfo, RB_PUMP_PAUSE_CMD,
"jargon");
if (ret) {
gf_log ("", GF_LOG_DEBUG,
"Failed to send command to pump");
- goto out;
+
}
ret = rb_destroy_maintainence_client (volinfo, src_brickinfo);
@@ -1991,6 +1998,9 @@ rb_do_operation_pause (glusterd_volinfo_t *volinfo,
goto out;
}
+ gf_log ("", GF_LOG_DEBUG,
+ "unmounted the replace brick client");
+
ret = 0;
out:
@@ -2031,14 +2041,16 @@ rb_do_operation_abort (glusterd_volinfo_t *volinfo,
goto out;
}
+ gf_log ("", GF_LOG_DEBUG,
+ "mounted the replace brick client");
+
ret = rb_send_xattr_command (volinfo, src_brickinfo,
dst_brickinfo, RB_PUMP_ABORT_CMD,
"jargon");
if (ret) {
gf_log ("", GF_LOG_DEBUG,
"Failed to send command to pump");
- goto out;
- }
+ }
ret = rb_destroy_maintainence_client (volinfo, src_brickinfo);
if (ret) {
@@ -2048,6 +2060,9 @@ rb_do_operation_abort (glusterd_volinfo_t *volinfo,
goto out;
}
+ gf_log ("", GF_LOG_DEBUG,
+ "unmounted the replace brick client");
+
ret = 0;
out:
@@ -2135,13 +2150,16 @@ rb_do_operation_status (glusterd_volinfo_t *volinfo,
goto out;
}
+ gf_log ("", GF_LOG_DEBUG,
+ "mounted the replace brick client");
+
ret = rb_get_xattr_command (volinfo, src_brickinfo,
dst_brickinfo, RB_PUMP_STATUS_CMD,
&status);
if (ret) {
gf_log ("", GF_LOG_DEBUG,
"Failed to get status from pump");
- goto out;
+ goto umount;
}
gf_log ("", GF_LOG_DEBUG,
@@ -2152,13 +2170,13 @@ rb_do_operation_status (glusterd_volinfo_t *volinfo,
gf_log ("", GF_LOG_ERROR,
"Operation Context is not present");
ret = -1;
- goto out;
+ goto umount;
}
status_reply = gf_strdup (status);
if (!status_reply) {
gf_log ("", GF_LOG_ERROR, "Out of memory");
ret = -1;
- goto out;
+ goto umount;
}
ret = dict_set_dynstr (ctx, "status-reply",
@@ -2166,18 +2184,21 @@ rb_do_operation_status (glusterd_volinfo_t *volinfo,
if (ret) {
gf_log ("", GF_LOG_DEBUG,
"failed to set pump status in ctx");
- goto out;
+
}
+ umount:
ret = rb_destroy_maintainence_client (volinfo, src_brickinfo);
if (ret) {
gf_log ("", GF_LOG_DEBUG,
"Failed to destroy maintainence "
"client");
- goto out;
- }
+ goto out;
+ }
}
+ gf_log ("", GF_LOG_DEBUG,
+ "unmounted the replace brick client");
out:
return ret;
}