summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/options.c
diff options
context:
space:
mode:
authorVijay Bellur <vijay@gluster.com>2011-08-20 15:18:09 +0530
committerVijay Bellur <vijay@gluster.com>2011-08-20 03:08:18 -0700
commit7fe3d3fe2b0bec8085b15fb4d9db8fdead826d57 (patch)
treeffdfe8ad434e6c644bc291dca3bd4b8a8e34104f /libglusterfs/src/options.c
parent7c6cf654700fb05502591e84b2000bb5230283e2 (diff)
libglusterfs: Fix a crash in gluster volume set help
Change-Id: I585e8e685f5c23b6fa632ef708adf2e349ba6704 BUG: 3415 Reviewed-on: http://review.gluster.com/274 Reviewed-by: Raghavendra Bhat <raghavendrabhat@gluster.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'libglusterfs/src/options.c')
-rw-r--r--libglusterfs/src/options.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/libglusterfs/src/options.c b/libglusterfs/src/options.c
index dee3c91854f..ccd57e4f07f 100644
--- a/libglusterfs/src/options.c
+++ b/libglusterfs/src/options.c
@@ -567,12 +567,19 @@ static volume_option_t *
xlator_volume_option_get_list (volume_opt_list_t *vol_list, const char *key)
{
volume_option_t *opt = NULL;
+ volume_opt_list_t *opt_list = NULL;
volume_option_t *found = NULL;
int index = 0;
int i = 0;
char *cmp_key = NULL;
- opt = vol_list->given_opt;
+ if (!vol_list->given_opt) {
+ opt_list = list_entry (vol_list->list.next, volume_opt_list_t,
+ list);
+ opt = opt_list->given_opt;
+ } else
+ opt = vol_list->given_opt;
+
for (index = 0; opt[index].key && opt[index].key[0]; index++) {
for (i = 0; i < ZR_VOLUME_MAX_NUM_KEY; i++) {
cmp_key = opt[index].key[i];