diff options
author | Kaushal M <kaushal@redhat.com> | 2012-06-27 11:04:48 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2012-07-17 23:46:34 -0700 |
commit | ed9a37fdf4c110697a3c6201764be7ccbb91573e (patch) | |
tree | 8edf2f978e479b6a0ad3c6a1f62cc0a107011644 /xlators | |
parent | 01b365d5bba3bea0847bc79fb5dfe82e5c75dc91 (diff) |
glusterd: Fix peer probe when username/password is missing
Prevent failure of building volumes dictionary during peer probe, when
username/password for a volume is missing. This situation can be caused by
migration of gluster from pre-3.3 to 3.3 and above.
BUG: 834229
Change-Id: I042ecfcc5024e6b18c4ffb44ea0977ec58e22ef8
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.com/3629
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index c0597772b15..ce3d0739719 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -1716,24 +1716,20 @@ glusterd_add_volume_to_dict (glusterd_volinfo_t *volinfo, memset (key, 0, sizeof (key)); snprintf (key, sizeof (key), "volume%d.username", count); str = glusterd_auth_get_username (volinfo); - if (!str) { - ret = -1; - goto out; + if (str) { + ret = dict_set_dynstr (dict, key, gf_strdup (str)); + if (ret) + goto out; } - ret = dict_set_dynstr (dict, key, gf_strdup (str)); - if (ret) - goto out; memset (key, 0, sizeof (key)); snprintf (key, sizeof (key), "volume%d.password", count); str = glusterd_auth_get_password (volinfo); - if (!str) { - ret = -1; - goto out; + if (str) { + ret = dict_set_dynstr (dict, key, gf_strdup (str)); + if (ret) + goto out; } - ret = dict_set_dynstr (dict, key, gf_strdup (str)); - if (ret) - goto out; memset (key, 0, sizeof (key)); snprintf (key, 256, "volume%d."GLUSTERD_STORE_KEY_RB_STATUS, count); |