From f7bbe289616a282f4f28e1537a71bc3f6bf67c8a Mon Sep 17 00:00:00 2001 From: Atin Mukherjee Date: Wed, 11 May 2016 18:24:40 +0530 Subject: glusterd: copy real_path from older brickinfo during brick import Backport of http://review.gluster.org/14306 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: 1337114 Signed-off-by: Atin Mukherjee Reviewed-on: http://review.gluster.org/14306 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Kaushal M Reviewed-on: http://review.gluster.org/14411 --- xlators/mgmt/glusterd/src/glusterd-op-sm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'xlators/mgmt/glusterd/src/glusterd-op-sm.c') 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; -- cgit