summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-op-sm.c
diff options
context:
space:
mode:
authorAtin Mukherjee <amukherj@redhat.com>2016-05-11 18:24:40 +0530
committerKaushal M <kaushal@redhat.com>2016-05-18 02:06:07 -0700
commit5a4f4a945661a8bb24735524e152ccd5b1ba571a (patch)
tree27b1ab6c32de79672debb01b518e4464672e2fba /xlators/mgmt/glusterd/src/glusterd-op-sm.c
parenta84034a5f7f547790c095950cd8a697c8c7b31ca (diff)
glusterd: copy real_path from older brickinfo during brick import
In glusterd_import_new_brick () new_brickinfo->real_path will not be populated for the first time and hence if the underlying file system is bad for the same brick, import will fail resulting in inconsistent configuration data. Fix is to populate real_path from old brickinfo object. Also there were many cases where we were unnecessarily calling realpath() and that may cause in failure. For eg - if a remove brick is executed with a brick whoose underlying file system has crashed, remove-brick fails since realpath() call fails. We'd need to call realpath() here as the value is of no use.Hence passing construct_realpath as _gf_false in glusterd_volume_brickinfo_get_by_brick () is a must in such cases. Change-Id: I7ec93871dc9e616f5d565ad5e540b2f1cacaf9dc BUG: 1335531 Signed-off-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-on: http://review.gluster.org/14306 Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaushal M <kaushal@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-op-sm.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-op-sm.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
index 033fc5759f2..e9f261c2fb3 100644
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
@@ -1724,7 +1724,7 @@ glusterd_op_stage_status_volume (dict_t *dict, char **op_errstr)
ret = glusterd_volume_brickinfo_get_by_brick (brick, volinfo,
&brickinfo,
- _gf_true);
+ _gf_false);
if (ret) {
snprintf (msg, sizeof(msg), "No brick %s in"
" volume %s", brick, volname);
@@ -3242,7 +3242,7 @@ glusterd_op_status_volume (dict_t *dict, char **op_errstr,
ret = glusterd_volume_brickinfo_get_by_brick (brick,
volinfo,
&brickinfo,
- _gf_true);
+ _gf_false);
if (ret)
goto out;
@@ -5953,7 +5953,7 @@ glusterd_bricks_select_remove_brick (dict_t *dict, char **op_errstr,
ret = glusterd_volume_brickinfo_get_by_brick (brick, volinfo,
&brickinfo,
- _gf_true);
+ _gf_false);
if (ret)
goto out;
@@ -6813,7 +6813,7 @@ glusterd_bricks_select_status_volume (dict_t *dict, char **op_errstr,
ret = glusterd_volume_brickinfo_get_by_brick (brickname,
volinfo,
&brickinfo,
- _gf_true);
+ _gf_false);
if (ret)
goto out;