summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-replace-brick.c
diff options
context:
space:
mode:
authorAtin Mukherjee <amukherj@redhat.com>2016-04-11 16:07:40 +0530
committerJeff Darcy <jdarcy@redhat.com>2016-04-11 11:39:16 -0700
commitd129d4eea33aae5db24dba17adcb04e9d4829817 (patch)
tree24044605fc12b071715ab4f7189672591428942c /xlators/mgmt/glusterd/src/glusterd-replace-brick.c
parent65575da24088ba4602b94db649be12376b87484f (diff)
glusterd: populate brickinfo->real_path conditionally
glusterd_brickinfo_new_from_brick () is called from multiple places and one of them is glusterd_brick_rpc_notify where its very well possible that an underlying brick's file system has crashed and a disconnect event has been received. In this case glusterd tries to build the brickinfo from the brickid in the RPC request, however the same fails as glusterd_brickinfo_new_from_brick () fails from realpath. Fix is to skip populating real_path if its a disconnect event. Change-Id: I9d9149c64a9cf2247abb731f219c1b1eef037960 BUG: 1325841 Signed-off-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-on: http://review.gluster.org/13965 Smoke: Gluster Build System <jenkins@build.gluster.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-replace-brick.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-replace-brick.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-replace-brick.c b/xlators/mgmt/glusterd/src/glusterd-replace-brick.c
index 535f1256baf..30e6ee850e9 100644
--- a/xlators/mgmt/glusterd/src/glusterd-replace-brick.c
+++ b/xlators/mgmt/glusterd/src/glusterd-replace-brick.c
@@ -294,7 +294,8 @@ glusterd_op_stage_replace_brick (dict_t *dict, char **op_errstr,
}
ret = glusterd_volume_brickinfo_get_by_brick (src_brick, volinfo,
- &src_brickinfo);
+ &src_brickinfo,
+ _gf_true);
if (ret) {
snprintf (msg, sizeof (msg), "brick: %s does not exist in "
"volume: %s", src_brick, volname);
@@ -363,7 +364,8 @@ glusterd_op_stage_replace_brick (dict_t *dict, char **op_errstr,
goto out;
}
- ret = glusterd_brickinfo_new_from_brick (dst_brick, &dst_brickinfo);
+ ret = glusterd_brickinfo_new_from_brick (dst_brick, &dst_brickinfo,
+ _gf_true);
if (ret)
goto out;
@@ -548,8 +550,8 @@ glusterd_op_perform_replace_brick (glusterd_volinfo_t *volinfo,
conf = this->private;
GF_ASSERT (conf);
- ret = glusterd_brickinfo_new_from_brick (new_brick,
- &new_brickinfo);
+ ret = glusterd_brickinfo_new_from_brick (new_brick, &new_brickinfo,
+ _gf_true);
if (ret)
goto out;
@@ -559,7 +561,8 @@ glusterd_op_perform_replace_brick (glusterd_volinfo_t *volinfo,
goto out;
ret = glusterd_volume_brickinfo_get_by_brick (old_brick,
- volinfo, &old_brickinfo);
+ volinfo, &old_brickinfo,
+ _gf_true);
if (ret)
goto out;
@@ -678,7 +681,8 @@ glusterd_op_replace_brick (dict_t *dict, dict_t *rsp_dict)
}
ret = glusterd_volume_brickinfo_get_by_brick (src_brick, volinfo,
- &src_brickinfo);
+ &src_brickinfo,
+ _gf_true);
if (ret) {
gf_msg_debug (this->name, 0,
"Unable to get src-brickinfo");