diff options
author | Yaniv Kaul <ykaul@redhat.com> | 2019-09-30 20:27:27 +0300 |
---|---|---|
committer | Atin Mukherjee <amukherj@redhat.com> | 2019-10-14 09:23:01 +0000 |
commit | cdf34880e6788a396c8f02ba7e0263ea09d3676a (patch) | |
tree | 5749ea938730f2ef1024854cc15b44d5461d5577 /libgfdb.pc.in | |
parent | 704961a39ffd019487e36ac6dbd425399cb85cf2 (diff) |
glusterd-volgen.c: fix setting the key export-dir
The return value of gf_asprintf() was used as the key length,
and it was stored into ret.
ret was re-used before the dict function was called, therefore was invalid
as the real key length and contained a different value.
That was masked by the fact the key length was only used in key hash, so
while it was incorrect, it was harmless. The hash was consistent and
the key length was re-calculated anyway in dict_set_lk().
This patch fixes it, so later on we can use the key length also in
dict_set_lk() to save another strlen() (sent in a different patch).
However, in the course of this patch I've also decided to reduce the
copy-pasta in this code path and put all NFS options in an array
and iterate through them. This makes the code shorter and easier to read.
(It's also more efficient since once an entry was found, there's no
additional strcmp()'s as the previous code did).
Change-Id: I968ed50a55f3b1a7ad027c72b06e0fa3788eaa9b
updates: bz#1193929
Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
Diffstat (limited to 'libgfdb.pc.in')
0 files changed, 0 insertions, 0 deletions