IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an
email to Administrator. User accounts are meant only to access repo
and report issues and/or generate pull requests.
This is a purpose-specific Git hosting for
BaseALT
projects. Thank you for your understanding!
Только зарегистрированные пользователи имеют доступ к сервису!
Для получения аккаунта, обратитесь к администратору.
`address_family=inet6` needs to be added while mounting master and
slave volumes in gverify script.
New option introduced to gluster cli(`--inet6`) which will be used
internally by geo-rep while calling `gluster volume info
--remote-host=<ipv6>`.
Backport of https://review.gluster.org/22363
Fixes: bz#1695436
Change-Id: I1e0d42cae07158df043e64a2f991882d8c897837
Signed-off-by: Aravinda VK <avishwan@redhat.com>
(cherry picked from commit 240e1d6821fbb779c3dd73f6f0225d755a5b7cc6)
Problem:
Returning any value from socket event handlers to the event sub-system
doesn't make sense since event sub-system cannot handle socket
sub-system errors.
Solution:
Change return type of all socket event handlers to 'void'
mainline:
> Change-Id: I70dc2c57f12b7ea2fae41120f71aa0d7fe0b2b6f
> Fixes: bz#1651246
> Signed-off-by: Milind Changire <mchangir@redhat.com>
> Reviewed-on: https://review.gluster.org/c/glusterfs/+/22221
Change-Id: I70dc2c57f12b7ea2fae41120f71aa0d7fe0b2b6f
Fixes: bz#1683900
Signed-off-by: Milind Changire <mchangir@redhat.com>
(cherry picked from commit 776ba851c6ee6c265253d44cf1d6e4e3d4a21772)
gluster volume set <VOLUME> group <GROUP> is used for setting multiple
pre-defined volume options, but this was undocumented. This patch doc-
ments this feature.
fixes: bz#1243991
Change-Id: Id346cf2537f85179caff32479f09555ce2e72e76
Signed-off-by: Rinku Kothiya <rkothiya@redhat.com>
When gluster command is fired without any arguments it just shows the
prompt, so added a welcome message and info to get help.
fixes: bz#1535528
Change-Id: I627b66b67443716e9270025c1e47b98b6facba13
Signed-off-by: Rinku Kothiya <rkothiya@redhat.com>
Added functionality to gluster volume set auth.allow command to
accept CIDR IP addresses. Modified few functions to isolate cidr
feature so that it prevents other gluster commands such as peer
probe to use cidr format ip. The functions are modified in such
a way that they have an option to enable accepting of cidr
format for other gluster commands if required in furture.
updates: bz#1138841
Change-Id: Ie6734002a7078f1820e5df42d404411cce945e8b
Credits: Mohit Agrawal
Signed-off-by: Rinku Kothiya <rkothiya@redhat.com>
They were not used at all, just taking space.
I've also marked all those that are not common really, but used
in just one place - they probably should move there (in follow-up
patches)
As a test, I've removed from the stripe xlator unused private
enums and moved one that was in the common list, but only
used in the stripe code, to be a private enum.
Compile-tested only!
updates: bz#1193929
Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
Change-Id: I1158dc1d259f1fd3f69904336c46c9d83cea799f
Problem: Declared variable-length array can have zero size
Added a goto statement to address this issue.
Updates: bz#1622665
Change-Id: Ibf80643490367a5f7e50f66f87e4296380be45de
Signed-off-by: Sheetal Pamecha <sheetal.pamecha08@gmail.com>
Problem: In some of the cli fops dict_allocate_and_serialize
allocate memory for req structure but after submit
request it missed to cleanup memory fo req.dict.dict_val
Solution: Call GF_FREE for req.dict.dict_val after submit
cli request
Change-Id: I76c6b3082fa0be21dc595f87701550a318734ea5
updates: bz#1633930
Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
Tracebacks:
Direct leak of 96 byte(s) in 1 object(s) allocated from:
#0 0x7f3acf9eac48 in malloc (/lib64/libasan.so.5+0xeec48)
#1 0x7f3acf510949 in __gf_malloc ./libglusterfs/src/mem-pool.c:136
#2 0x7f3acf5111bb in gf_vasprintf ./libglusterfs/src/mem-pool.c:236
#3 0x7f3acf51138a in gf_asprintf ./libglusterfs/src/mem-pool.c:256
#4 0x421611 in cli_cmd_volume_set_cbk ./cli/src/cli-cmd-volume.c:868
#5 0x410599 in cli_cmd_process ./cli/src/cli-cmd.c:135
#6 0x40f90d in cli_batch ./cli/src/input.c:29
#7 0x7f3acd78c593 in start_thread pthread_create.c:463
Direct leak of 73 byte(s) in 1 object(s) allocated from:
#0 0x7f3acf9eac48 in malloc (/lib64/libasan.so.5+0xeec48)
#1 0x7f3acf510949 in __gf_malloc ./libglusterfs/src/mem-pool.c:136
#2 0x421519 in gf_strndup ../../libglusterfs/src/mem-pool.h:167
#3 0x421519 in gf_strdup ../../libglusterfs/src/mem-pool.h:184
#4 0x421519 in cli_cmd_volume_set_cbk cli/src/cli-cmd-volume.c:859
#5 0x410599 in cli_cmd_process cli/src/cli-cmd.c:135
#6 0x40f90d in cli_batch cli/src/input.c:29
#7 0x7f3acd78c593 in start_thread pthread_create.c:463
Change-Id: I3312751c1e3178672360a678fe15b1f7f1054b22
updates: bz#1633930
Signed-off-by: Kotresh HR <khiremat@redhat.com>
libglusterfs devel package headers are referenced in code using
include semantics for a program, this while it works can be better
especially when dealing with out of tree xlator builds or in
general out of tree devel package usage.
Towards this, the following changes are done,
- moved all devel headers under a glusterfs directory
- Included these headers using system header notation <> in all
code outside of libglusterfs
- Included these headers using own program notation "" within
libglusterfs
This change although big, is just moving around the headers and
making it correct when including these headers from other sources.
This helps us correctly include libglusterfs includes without
namespace conflicts.
Change-Id: Id2a98854e671a7ee5d73be44da5ba1a74252423b
Updates: bz#1193929
Signed-off-by: ShyamsundarR <srangana@redhat.com>
This Patch fixes memory leak reported by ASan.
Leaks are in gf_cli_status_cbk as a result of allocatating memory
using gf_asprintf in loop.
SUMMARY: AddressSanitizer: 535 byte(s) leaked in 7 allocation(s).
Change-Id: If2fd76c7c1ea6fc44baca295050800074f9d1323
updates: bz#1633930
Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
This patch fixes Indirect leaks in cli-cmd-volume.c
Leaks are happening in cli_cmd_quota_cbk and
cli_cmd_quota_handle_list_all.
SUMMARY: AddressSanitizer: 1152 byte(s) leaked in 8 allocation(s)
Updates: bz#1633930
Change-Id: Ia6c0306e88bd81f74d1220303ead8095fbcf5623
Signed-off-by: Harpreet kaur <hlalwani@redhat.com>
Added a usage message which will be shown when a user enters an
"unrecognized word" or an "unrecognized command" on the cli.
Also added a "--help" option for gluster cli.
fixes: bz#1535495
Change-Id: Ibcfb3d1c84daa1054e09c5cdfa6a5dab19f534a6
Signed-off-by: Harpreet Kaur Lalwani <hlalwani@redhat.com>
This patch fixes memory leak in cli-rpc-ops.c.
All leaks are happening in gf_cli_remove_brick_cbk.
SUMMARY: AddressSanitizer: 2944 byte(s) leaked in 22 allocation(s).
updates: bz#1633930
Change-Id: I1e58d538eb9135f1aadcdb54d10b72f55e8a53d1
Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
A single global per program queue is contended by all request handler
threads and event threads. This can lead to high contention. So,
reduce the contention by providing each request handler thread its own
private queue.
Thanks to "Manoj Pillai"<mpillai@redhat.com> for the idea of pairing a
single queue with a fixed request-handler-thread and event-thread,
which brought down the performance regression due to overhead of
queuing significantly.
Thanks to "Xavi Hernandez"<xhernandez@redhat.com> for discussion on
how to communicate the event-thread death to request-handler-thread.
Thanks to "Karan Sandha"<ksandha@redhat.com> for voluntarily running
the perf benchmarks to qualify that performance regression introduced
by ping-timer-fixes is fixed with this patch and patiently running
many iterations of regression tests while RCAing the issue.
Thanks to "Milind Changire"<mchangir@redhat.com> for patiently running
the many iterations of perf benchmarking tests while RCAing the
regression caused by ping-timer-expiry fixes.
Change-Id: I578c3fc67713f4234bd3abbec5d3fbba19059ea5
Fixes: bz#1644629
Signed-off-by: Raghavendra Gowdappa <rgowdapp@redhat.com>
Modified Geo-rep help text for better sanity.
Change-Id: I48f4d0fd60c1ffcde753b37416e0c73afd0b5702
fixes: bz#1652887
Signed-off-by: Shwetha K Acharya <sacharya@redhat.com>
....and if set, change the log level to GF_LOG_NONE. This is useful for
monitoring applications which invoke the heal info set of commands once
every minute, leading to un-necessary glfsheal* logs in
/var/log/glusterfs/. For example, we can now run
`gluster volume heal <VOLNAME> info --nolog`
`gluster volume heal <VOLNAME> info split-brain --nolog` etc.
The default log level is still retained at GF_LOG_INFO.
The patch also changes glfsheal internally to accept '--xml' instead of 'xml'.
Note: The --nolog flag is *not* displayed in the help anywhere, for the
sake of consistency in how the other flags are not displayed anywhere in
the help.
fixes: bz#1643519
Change-Id: Ia08b6aa6e4a0548379db7e313dd4411ebc66f206
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
Added a strlen check to ensure that the format is (Y-m-d H:M:S).
Change-Id: I8844aaa33418d43ffe2320c4a05eb1eddd306903
updates: bz#1651584
Signed-off-by: Shwetha Acharya <sacharya@gmail.com>
Found while looking at this function for another patch.
Compile Tested Only!
Updates bz#1193929
Change-Id: I46a9e95bf4d6609bc122edf86418659369258abe
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
On a multi node cluster if one of the node is detached which had active
clients mounted through the same server address, this can cause all the
clients to loose any volfile changes. This is due to the lack of infra
in glusterd to let client know the list of IPs and attempt to connect to
other active nodes as failback. Such framework does exist in GD2 but not
in GD1.
This patch ensures to take a preventive measure to have a warning
message thrown to user to ensure all such connected clients are
remounted through a different IP.
Change-Id: I740b01868abbd75bf0a609cfaf00114d4d78aa96
Fixes: bz#1647074
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
Currently, there are possibilities in few places, where a user-controlled
(like filename, program parameter etc) string can be passed as 'fmt' for
printf(), which can lead to segfault, if the user's string contains '%s',
'%d' in it.
While fixing it, makes sense to make the explicit check for such issues
across the codebase, by making the format call properly.
Fixes: CVE-2018-14661
Fixes: bz#1644763
Change-Id: Ib547293f2d9eb618594cbff0df3b9c800e88bde4
Signed-off-by: Amar Tumballi <amarts@redhat.com>
Based on the proposal to remove few features as they are not
actively maintained [1], removing stripe translator from the
build. Also make sure there are no regression tests involving
stripe translator.
[1] https://lists.gluster.org/pipermail/gluster-users/2018-July/034400.html
Note that this patch aims at removing the translator from build, and
a followup patch is needed to remove the code from repository.
Updates: bz#1364707
Change-Id: I235b305338f138e29e9f30cba65bc0dadbebbbd5
Signed-off-by: Amar Tumballi <amarts@redhat.com>
Problem:
EC volumes can be created without any redundant brick.
Solution:
Updated the conditional check to avoid volume create without
redundant brick.
fixes: bz#1642448
Change-Id: I0cb334b1b9378d67fcb8abf793dbe312c3179c0b
Signed-off-by: Sunil Kumar Acharya <sheggodu@redhat.com>
dict_get_str_boolean expects a integer, so we need
to set all the boolean variables as integers to
avoid log messages like below:
[2018-09-10 03:55:19.236387] I [dict.c:2838:dict_get_str_boolean] (-->/usr/local/lib/libgfrpc.so.0(rpc_clnt_reconnect+0xc2) [0x7ff7a83d0452] -->/usr/local/lib/glusterfs/4.2dev/rpc-transport/socket.so(+0x65b0) [0x7ff7a06cf5b0] -->/usr/local/lib/libglusterfs.so.0(dict_get_str_boolean+0xcf) [0x7ff7a85fc58f] ) 0-dict: key transport.socket.ignore-enoent, integer type asked, has string type [Invalid argument]
This patch addresses all such instances in glusterd.
Change-Id: I7e1979fcf381363943f4d09b94c3901c403727da
updates: bz#1193929
Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
GF_MALLOC was being used to allocate memory which is
not initialized. strcat is used on it which could
result in buffer overflow if it contains garbage before
'\0'. So changed it to GF_CALLOC.
Traceback:
==23427==ERROR: AddressSanitizer: heap-buffer-overflow ...
WRITE of size 5 at 0x6080000083fe thread T3
#0 0x7fb60966991c in __interceptor_strcat ...
#1 0x48adc0 in config_parse ...
#2 0x48cde8 in cli_cmd_gsync_set_parse ...
...
Updates: bz#1633930
Change-Id: I3710f011d8139984b1898265d84d150c9bdc962b
Signed-off-by: Kotresh HR <khiremat@redhat.com>
'gf_cli_rsp' structure has 'op_errstr' and 'dict.dict_val'
which could get allocated by xdr and should be freed. This
patch takes care of all instances of the same.
Updates: bz#1633930
Change-Id: I2a5d129ffe85cfca743c89edb45b658f3ce688cb
Signed-off-by: Kotresh HR <khiremat@redhat.com>
With this fix, a run on 'rpc-coverage.t' passes properly.
This should help to get started with other fixes soon!
Change-Id: I257ae4e28b9974998a451d3b490cc18c02650ba2
updates: bz#1633930
Signed-off-by: Amar Tumballi <amarts@redhat.com>
If use this command every some seconds for example 15s to check gluster brick
status, the glusterd will use about 1G memory in a year. free the value of rsp
in gf_cli_status_cbk. glusterd allocate the value of rsp and send it to cli, but
cli do not free the value, that cause glusterd memory leak.
fixes: bz#1635480
Change-Id: I3f19cd0d4b791ae1b35f9664b3a668b1579f1178
Signed-off-by: shujun10086 <shujun.huang@nokia-sbell.com>
When control flow reaches negative case code block, we added
"goto out" statement without assigning ret to -1.
This patch assigns return value to -1, before going to the lable "out".
Change-Id: I6db651a3c9ca285ade9ee1ca23d0abe6b36fda3a
updates: bz#1193929
Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
In a previous patch (https://review.gluster.org/20769) we've
added the key length to be passed to dict_* funcs, to remove the need
to strlen() it. This patch moves some code to use it.
Please review carefully.
Compile-tested only!
updates: bz#1193929
Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
Change-Id: If4f425a9827be7c36ccfbb9761006ae824a818c6
Currently while creating replica 2 volume we display a warning message
of ending up in split-brain. But while converting an existing volume
from other configuration to replica 2 by add-brick or remove-brick
operations we do not show any such messages.
With this fix in add-brick and remove-brick cases also we will display
the same warning message and prompt for confirmation if the configuration
changes to replica 2.
Change-Id: Ifc4ed6994a087d2403894f4e743c4eb41633276b
fixes: bz#1627044
Signed-off-by: karthik-us <ksubrahm@redhat.com>
It doesn't make sense to calloc (allocate and clear) memory
when the code right away fills that memory with data.
It may be optimized by the compiler, or have a microscopic
performance improvement.
In some cases, also changed allocation size to be sizeof some
struct or type instead of a pointer - easier to read.
In some cases, removed redundant strlen() calls by saving the result
into a variable.
1. Only done for the straightforward cases. There's room for improvement.
2. Please review carefully, especially for string allocation, with the
terminating NULL string.
Only compile-tested!
updates: bz#1193929
Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
Change-Id: Ic1531afbf614823628cc8d70bae782d4db7ec033
This patch fixes 1175017 and 1382401.
This patch fixes resource leak by validating brick_count is valid or
not. If brick_count is not valid we are coming out in "cli_cmd_bricks_parse"
without allocating memory to "brick_str" which is eventually pointed by bricks.
Change-Id: I8ed0f29495379ec49484c5c4069865db3653506f
updates: bz#789278
Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
xlators/cluster/stripe/src/stripe-helpers.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible
xlators/cluster/dht/src/tier.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible
xlators/cluster/dht/src/dht-layout.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible
xlators/cluster/dht/src/dht-helper.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible
xlators/cluster/dht/src/dht-common.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible
xlators/cluster/afr/src/afr.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible
xlators/cluster/afr/src/afr-inode-read.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible
tests/bugs/replicate/bug-1250170-fsync.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible
tests/basic/gfapi/gfapi-async-calls-test.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible
tests/basic/ec/ec-fast-fgetxattr.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible
rpc/xdr/src/glusterfs3.h: Move to GF_MALLOC() instead of GF_CALLOC() when possible
rpc/rpc-transport/socket/src/socket.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible
rpc/rpc-lib/src/rpc-clnt.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible
extras/geo-rep/gsync-sync-gfid.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible
cli/src/cli-xml-output.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible
cli/src/cli-rpc-ops.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible
cli/src/cli-cmd-volume.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible
cli/src/cli-cmd-system.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible
cli/src/cli-cmd-snapshot.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible
cli/src/cli-cmd-peer.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible
cli/src/cli-cmd-global.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible
It doesn't make sense to calloc (allocate and clear) memory
when the code right away fills that memory with data.
It may be optimized by the compiler, or have a microscopic
performance improvement.
In some cases, also changed allocation size to be sizeof some
struct or type instead of a pointer - easier to read.
In some cases, removed redundant strlen() calls by saving the result
into a variable.
1. Only done for the straightforward cases. There's room for improvement.
2. Please review carefully, especially for string allocation, with the
terminating NULL string.
Only compile-tested!
updates: bz#1193929
Original-Author: Yaniv Kaul <ykaul@redhat.com>
Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
Signed-off-by: Amar Tumballi <amarts@redhat.com>
Change-Id: I16274dca4078a1d06ae09a0daf027d734b631ac2