| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Addresses the following CIDs:
1388821: Unchecked return value from sys_lremovexattr() in
glusterd_check_and_set_brick_xattr()
1370957: Unused return value in glusterd_volume_tier_use_rsp_dict()
1370950: Memory leak in glusterd_get_global_options_for_all_vols()
1370946: Redundant gf_strdup() leading to a memory leak in
glusterd_get_global_options_for_all_vols()
Change-Id: I2ab58207bc43b40f004ee18463430a141126bf94
Updates: bz#789278
Signed-off-by: Vijay Bellur <vbellur@redhat.com>
|
|
|
|
|
|
|
|
| |
Addresses CID: 1274132, 1325534
Change-Id: I176612ef5baf5618d543838a5f32db7dcd7002c3
updates: bz#789278
Signed-off-by: Vijay Bellur <vbellur@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
only_connect is true
With the latest refactoring in glusterd_brick_start () function in case
we run into a situation where is_gf_service_running () return a valid
pid which is running but doesn't belong to a gluster process, even in
case of only_connect flag passed as gf_true we'd end up trying to start
a brick which would cause a deadlock in brick multiplexing as both
glusterd_restart_bricks () and glusterd_do_volume_quorum_action () would
cause context switching with each other for the same brick. The
following bt shows the same:
(gdb) t a a bt
Thread 8 (Thread 0x7fcced48a700 (LWP 11959)):
srch_vol=srch_vol@entry=0xbe0410, comp_vol=comp_vol@entry=0xc03680,
brickinfo=brickinfo@entry=0xc14ef0) at glusterd-utils.c:5834
brickinfo=0xc14ef0, volinfo=0xc03680, conf=<optimized out>)
at glusterd-utils.c:5902
brickinfo=brickinfo@entry=0xc14ef0, wait=wait@entry=_gf_false,
only_connect=only_connect@entry=_gf_true) at glusterd-utils.c:6251
volinfo=0xc03680, meets_quorum=_gf_true) at glusterd-server-quorum.c:402
at glusterd-server-quorum.c:443
iov=iov@entry=0x7fcce0004040, count=count@entry=1,
myframe=myframe@entry=0x7fcce00023a0) at glusterd-rpc-ops.c:542
iov=0x7fcce0004040, count=1, myframe=0x7fcce00023a0,
fn=0x7fccf12403d0 <__glusterd_friend_add_cbk>) at glusterd-rpc-ops.c:223
---Type <return> to continue, or q <return> to quit---
at rpc-transport.c:538
Thread 7 (Thread 0x7fccedc8b700 (LWP 11958)):
Thread 6 (Thread 0x7fccf1d67700 (LWP 11877)):
brickinfo=brickinfo@entry=0xc14ef0) at glusterd-utils.c:5834
at glusterd-utils.c:6251
Thread 5 (Thread 0x7fccf2568700 (LWP 11876)):
Thread 4 (Thread 0x7fccf2d69700 (LWP 11875)):
Thread 3 (Thread 0x7fccf356a700 (LWP 11874)):
Thread 2 (Thread 0x7fccf3d6b700 (LWP 11873)):
---Type <return> to continue, or q <return> to quit---
Thread 1 (Thread 0x7fccf68a8780 (LWP 11872)):
Fix:
The solution is to ensure we don't restart bricks if only_connect is
true and just ensure that the brick is attempted to be connected.
Test:
Simulated a code change to ensure gf_is_service_running () always return
to true to hit the scenario.
Change-Id: Iec184e6c9e8aabef931d310f931f4d7a580f0f48
Fixes: bz#1620544
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
The the error message variable changed in scope - defined in a smaller scope.
Compile-tested only!
Change-Id: I16dda11c30099b0e448b8e44a300f153727ce8da
updates: bz#1193929
Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
variable
Size of error message variable reduced from 2048 bytes to 64 bytes or
128 bytes.
Compile-tested only!
Change-Id: I393ba03969a6e71ccb0ce382d0e0546192897312
updates: bz#1193929
Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
const char
declare err_str as const char and intialize it at the time of declaration.
Compile-tested only!
Change-Id: If07e1130e819ce042905a2d0be650cd7afc2b558
updates: bz#1193929
Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
variable
Size of error message variable reduced from 2048 bytes to 256 bytes.
Compile-tested only!
Change-Id: Ifc0f6af2256bcbec77102767ba651d5d55f8c906
updates: bz#1193929
Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
Size of error message variable reduced from 4096 bytes to 128 bytes.
Compile-tested only!
Change-Id: I08c87502be791e68ab767ed96657ac89ee77fae0
updates: bz#1193929
Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Addresses the following CIDs:
1370941: Unconditional memory leak in glusterd_print_snapinfo_by_vol()
1370943: Memory leak when opendir fails for output directory in
glusterd_get_state()
Change-Id: I9536841629e1ffe1fed79a8e57d266a0e953e5af
updates: bz#789278
Signed-off-by: Vijay Bellur <vbellur@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
| |
The error and/or message variable was changed in scope:
defined in a smaller scope.
Compile-tested only!
Change-Id: I5e46a1992ad35a996aa8ee58da28606ac018ab8e
updates: bz#1193929
Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
message variable
The the error and/or message variable was either:
- Reduced in size - from 2048 bytes to 64 bytes, for example.
or
- Changed in scope - defined in a smaller scope.
Compile-tested only!
Change-Id: I9c609415667844ee034b7eb2b67bdbc19d38819d
updates: bz#1193929
Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
message variable
The the error and/or message variable was either:
- Reduced in size - from 2048 bytes to 64 bytes, for example.
or
- Changed in scope - defined in a smaller scope.
Compile-tested only!
Change-Id: Iebb92a56d9d0ca53c80d75866bcb7848e08cf6b2
updates: bz#1193929
Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
Size of error message variable reduced from 2048 bytes to 64 bytes.
Compile-tested only!
Change-Id: I65abd9c4f23a64ac9cda5373aff4119458addbc8
updates: bz#1193929
Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
message variable
The the error and/or message variable was either:
- Reduced in size - from 2048 bytes to 64 bytes, for example.
or
- Changed in scope - defined in a smaller scope.
Compile-tested only!
Change-Id: Ib74e5f8f4c2978f670d4708e9382e97edf5df0a7
updates: bz#1193929
Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
Size of error message variable reduced from 2048 bytes to 256 bytes.
Compile-tested only!
Change-Id: Ib536451d9b562f932132b99c4eff21fc4f2775bc
updates: bz#1193929
Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Addresses the following CIDs:
1124768: fd leak in __server_getspec() if spec_fd happens to be 0
1202400: Memory leak in get_snap_volname_and_volinfo()
1214622: Memory leak in glusterd_create_missed_snap()
1214623: Memory leak in an error path of __server_get_volume_info()
Change-Id: I33910b4125d25205e76e0d13cf0256d47bd8fc3c
updates: bz#789278
Signed-off-by: Vijay Bellur <vbellur@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Addresses the following CIDs:
- 1124704: Removed an unessential variable that caused a memory
leak in glusterd_op_set_volume(). Nuked an unnecessary log message upon
error as well since failure logging is being done in the caller
- 1124772: Memory leak in an error path of
glusterd_op_ac_send_brick_op()
- 1175021: Removed an unessential variable that caused a memory leak in
glusterd_op_build_payload()
Also addressed a memory leak in an error path of
glusterd_dict_set_volid()
Change-Id: I060effbbcebe9d58b91f606175080ede517ba239
updates: bz#789278
Signed-off-by: Vijay Bellur <vbellur@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problems : 1. Snapshot status for individual snapshots were failing after OS
upgrade from RHEL6 to RHEL7.
2. Post upgrade snapshot creation of cloned volume was failing.
Root Cause : When OS upgrade is from RHEL6 to RHEL7 there is difference in
symlink (/var/run) between these two versions.
Basically when (/var/run) is symlinked to /run, mount command
resolves path and mounts it. But at the same time call to
those functions fails who depends on absolute path.
(like strcmp in glusterd_get_mnt_entry_info)
Solution : Resolve the input path to absolute path before calling these
functions.
Test : Tested on same setup where issue was reported. After this
patch snapshot issues are completely resolved.
Change-Id: I5ba57998cea614c6072709f52f42a57562018844
fixes: bz#1619843
Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
glfs-fops.c
1391414 Uninitialized pointer read
List head needed initialization
glusterfsd-mgmt.c
graph.c
1382431 Buffer not null terminated
1382417 Dereference before null check
1382347 Buffer not null terminated
Cleaned usage of volfile_checksum member of gf_volfile_t struct
across the code base.
glusterd-tier.c
1382426 Resource leak
1370955 Dereference before null check
The function fixed needs more work, but with tier almost being
deprecated, addressed some parts of the reported coverity issues
as appropriate.
Tested using the following test cases:
./tests/basic/tier/new-tier-cmds.t
./tests/basic/tier/tier.t
./tests/basic/tier/bug-1214222-directories_missing_after_attach_tier.t
./tests/basic/tier/tier_lookup_heal.t
./tests/basic/tier/tier-heald.t
./tests/basic/tier/tier-snapshot.t
./tests/features/glfs-lease.t
Change-Id: I396f1c34bb112bb22d2745ed279e1a4850cac4af
Updates: bz#789278
Signed-off-by: ShyamsundarR <srangana@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
...and also changed char array initialization to from {0,} to "".
gcc version 8.1.1 20180712 (Red Hat 8.1.1-5) (GCC) on Fedora 28.
Sample warnings:
glusterd-utils.c:7234:41: warning: ‘.hostname’ directive output may be truncated writing 9 bytes into a region of size between 1 and 1024 [-Wformat-truncation=]
snprintf (key, sizeof (key), "%s.hostname", base_key);
^~~~~~~~~
glusterd-utils.c:7234:9: note: ‘snprintf’ output between 10 and 1033 bytes into a destination of size 1024
snprintf (key, sizeof (key), "%s.hostname", base_key);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
glusterd-snapshot.c:3090:65: warning: ‘/’ directive output may be truncated writing 1 byte into a region of size between 0 and 4095 [-Wformat-truncation=]
snprintf (snap_path, sizeof (snap_path) - 1, "%s/%s",
^
glusterd-snapshot.c:3090:17: note: ‘snprintf’ output between 2 and 4351 bytes into a destination of size 4095
snprintf (snap_path, sizeof (snap_path) - 1, "%s/%s",
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
snap_mount_dir, snap_vol->snapshot->snapname);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
glusterd-statedump.c:28:45: warning: ‘%s’ directive output may be truncated writing up to 4095 bytes into a region of size 144 [-Wformat-truncation=]
snprintf (subkey, sizeof (subkey), "%s%d", key, index);
^~ ~~~
glusterd-statedump.c:28:9: note: ‘snprintf’ output between 2 and 4107 bytes into a destination of size 144
snprintf (subkey, sizeof (subkey), "%s%d", key, index);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
updates: bz#1193929
Change-Id: Ic721f27b28d1221c124b570e81c55528f5b7f3cd
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes CID: 1241481 1241482 1274079 1274118 1274121 1274131 1274198
1274214 1274220 1274224 1394663 1394641 382454 1382453 1382449 1288095
Link: https://scan6.coverity.com/reports.htm#v42388/p10714/fileInstanceId=84772667&defectInstanceId=25770661&mergedDefectId=744716
Change-Id: Idaf434186231c8b0fff4b27c57fa23636a89c8a7
updates: bz#789278
Signed-off-by: Bhumika Goyal <bgoyal@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
problem:
During a handshake, when we import a friend data
snap description variable was just referenced to
dictionary value.
Solution:
snap description should have a separate memory allocated
through gf_strdup
Change-Id: I94da0c57919e1228919231d1563a001362b100b8
fixes: bz#1618004
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Snapshot was designed to support multiple volume snapshot,
hence the volume name keys are labelled with volume count.
So the volume key should have a volume count appended with
key
Change-Id: I044d73fc86db0e662dc914669aecfb82a6476fb5
fixes: bz#1618004
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch does the following:
1. Addresses CID: 1124815,124816,1124833,1291724,1325535,1325536,1357858
- by adding some null checks
- by handling return values from functions
- by using an appropriate buffer length in strncpy
2. Cleans up some commented code
Change-Id: I5a7079f34e3e460d5a6267734c3bc84bf4ad72f5
updates: bz#789278
Signed-off-by: Vijay Bellur <vbellur@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
Snapshot description should have a valid string. Creating a
snapshot with null value will cause reading from info file
to fail with a null exception
Change-Id: I9f84154b8e3e7ffefa5438807b3bb9b4e0d964ca
updates: bz#1618004
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Commit 1f3bfe7 stripped down the total size of certain path related variables
in glusterd_brickinfo_t which considered couple of new coverity defects.
Fix the following:
CID : 1394969 Destination buffer too small
CID : 1394968 Out-of-bounds access
Change-Id: Ibc30eac4680cc6c83bd89d248f1435cb6a3d1b75
updates: bz#789278
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem explanation:
Assuming in a 3 nodes cluster, if N1 originates a delete operation and
while N1's commit phase completes, either glusterd service of N2 or N3
gets disconnected from N1 (before completing the commit phase), N1 will
attempt to end up importing the volume which is in-flight for a delete
in other nodes as a fresh resulting into an incorrect configuration
state.
Fix:
Mark a volume as stage deleted once a volume delete operation passes
it's staging phase and reset this flag during unlock phase. Now during
this intermediate phase if the same volume gets imported to other peers,
it shouldn't considered to be recreated.
An automated .t is quite tough to implement with the current infra.
Test Case:
1. Keep creating and deleting volumes in a loop on a 3 node cluster
2. Simulate n/w failure between the peers (ifdown followed by ifup)
3. Check if output of 'gluster v list | wc -l' is same across all 3
nodes during 1 & 2.
Change-Id: Ifdd5dc39699120258d7fdd42fe2deb9de25c6246
Fixes: bz#1605077
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In case the development parts of libxml2 are not installed, it was
required to re-run ./autogen.sh to cleanup the cached values for the
check. This is not nice towards users. By using the standard
PKG_CHECK_MODULES for libxml-2.0 the results of the check are not cached
and will be probed again when running ./configure.
Change-Id: I3c4586e5555a521be5d4fb61bdb873ae0317311a
Fixes: bz#1599219
Reported-by: Sachidananda Urs <surs@redhat.com>
Signed-off-by: Niels de Vos <ndevos@redhat.com>
|
|
|
|
|
|
|
|
|
| |
Fixes CID : 1124789
updates: bz#789278
Change-Id: I61c70f05e6377d7ddc8961556274714dd356a117
Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
[sh]$ gcc --version
gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)
Warnings were of the type below:
xlators/mgmt/glusterd/src/glusterd-store.c:3285:33:
warning: ‘/options’ directive output may be truncated writing 8 bytes into a region of size between 1 and 4096 [-Wformat-truncation=]
snprintf (path, len, "%s/options", conf->workdir);
^~~~~~~~
xlators/mgmt/glusterd/src/glusterd-store.c:1280:39:
warning: ‘/snaps/’ directive output may be truncated writing 7 bytes into a region of size between 1 and 4096 [-Wformat-truncation=]
snprintf (snap_fpath, len, "%s/snaps/%s/%s", priv->workdir,
^~~~~~~
* Also changed some places where there was issues with key size
* Made sure all the 'char buf[SOMESIZE] = {0,};' are changed to 'char buf[SOMESIZE] = "";`
- In the files I changed
* Also edited coding standard to reflect that.
updates: bz#1193929
Change-Id: I04c652624ac63199cea2077e46b3a5def37c3689
Signed-off-by: Amar Tumballi <amarts@redhat.com>
|
|
|
|
|
|
|
|
| |
Fixes CID 1391418
Change-Id: I60ce6cd3b2528369f4dc1be81c0c15a1a806982a
updates: bz#789278
Signed-off-by: Vijay Bellur <vbellur@redhat.com>
|
|
|
|
|
|
|
|
| |
Fixes CID 1394647, 1394658
Change-Id: I30cf6e793919a08e0a3fe10622351b8316d7767c
updates: bz#789278
Signed-off-by: Vijay Bellur <vbellur@redhat.com>
|
|
|
|
|
|
|
|
|
| |
While it is a one line fix, it allows a significant unwanted memory
being allocated for defrag structure.
Updates: bz#1193929
Change-Id: Idda70d1d3dc0e7be56c35e872aa6edfaf752290d
Signed-off-by: Amar Tumballi <amarts@redhat.com>
|
|
|
|
|
|
|
|
| |
Fixes CID 1325557
Change-Id: I5e33ae19ddf4c44a49a2b3b3dea0c739bc96d3a7
updates: bz#789278
Signed-off-by: Vijay Bellur <vbellur@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
It's not needed.
There's a good chance the compiler is smart enough to remove it
anyway, but it can't hurt - I hope.
Compile-tested only!
Change-Id: Id7c054e146ba630227affa591007803f3046416b
updates: bz#1193929
Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
During friend handshake if the glusterd receives more than one friend
updates, it might very well become possible that two threads would end
up working on two different volinfo references and glusterd might end up
updating the store with a old volinfo reference. While debugging
glusterd crash from validating-server-quorum.t test file from the
line-coverage regression the same was observed.
Solution is to run glusterd_compare_friend_data under a mutex.
Test:
As the crash was more visible in the line-coverage run (given lcov does
some instrumentation and exposes the races), 6 manual lcov runs were
triggered starting from https://build.gluster.org/job/line-coverage/443
to https://build.gluster.org/job/line-coverage/449/ and no crash was
observed from validating-server-quorum.t
Change-Id: I86fce473a76fd24742d51bf17a685d28b90a8941
Fixes: bz#1603063
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: After reboot a node brick is not coming up because
fsid comparison is failed before start a brick
Solution: Instead of comparing fsid compare volume_id to
resolve the same because fsid is changed after
reboot a node but volume_id persist as a xattr
on brick_root path at the time of creating a volume.
Change-Id: Ic289aab1b4ebfd83bbcae8438fee26ae61a0fff4
fixes: bz#1612418
Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
While gf_attach () utility can help in detaching a brick instance from
the brick process which the kill_brick () function in tests/volume.rc
uses it has a caveat which is as follows:
1. It doesn't ensure the respective brick is marked as stopped which
glusterd does from glusterd_brick_stop
2. Sometimes if kill_brick () is executed just after a brick stack is
up, the mgmt_rpc_notify () can take some time before marking
priv->connected to 1 and before it if kill_brick () is executed, brick
will fail to initiate the pmap_signout which would inturn cleans up the
pidfile.
To avoid such possibilities, a more stricter check on if a brick is
running or not in brick multiplexing has been brought in now where it
not only checks for its pid's existance but checks if the respective
process has the brick instance associated with it before checking for
brick's status.
Change-Id: I98b92df949076663b9686add7aab4ec2f24ad5ab
Fixes: bz#1595320
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
gluster_shared_storage bricks
Problem: In a brick multiplexing environment, Bricks of a normal volume
created by user are getting attached to the bricks of a volume
"gluster_shared_storage" which is created by enabling the
enable-shared-storage option. Mounting gluster_shared_storage
has strict authentication checks. when we attach bricks of a normal
volume to bricks of gluster_shared_storage, mounting the normal
volume created by user will fail due to strict authentication checks.
Solution: We should not attach bricks of a normal volume to brick
process of gluster_shared_storage volume and vice versa.
fixes: bz#1610726
Change-Id: If1b5a2a02675789a2915ba480fb48c145449163d
Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
This patch moves stack based PATH_MAX allocations for tmpfile
names, to heap allocated names instead. Reducing the impact on
stack space used and accruing benefits thereof.
Change-Id: I646d9cb091018de6768b3523902788fa2ba14d96
Updates: bz#1193929
Signed-off-by: ShyamsundarR <srangana@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
mkstemp as per the Linux man page, uses 0600 as the permission
bits when creating the file. This is hence safe and a Coverity
warning that should be ignored.
Further, we are mostly a multi-threaded program in all our daemons
and cannot set and unset umask at will in a multi-threaded
program, to address the coverity issue.
This change attempts to nudge coverity to ignore this warning,
using the pattern,
/* coverity[EVENT_TAG_NAME] ... */
<line of code that has the issue>
This commit is an experiment, if post merge the next coverity
report ignores these errors, the above pattern (as found using
an internet search) works and can be applied to certain other
warnings as well.
Change-Id: I73a184ce1a54dd9e66542952b1190a74438c826a
Updates: bz#789278
Signed-off-by: ShyamsundarR <srangana@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: In brick mux scenario sometime glusterd is not able
to start/attach a brick and gluster v status shows
brick is already running
Solution:
1) To make sure brick is running check brick_path in
/proc/<pid>/fd , if a brick is consumed by the brick
process it means brick stack is come up otherwise not
2) Before start/attach a brick check if a brick is mounted
or not
3) At the time of printing volume status check brick is
consumed by any brick process
Test: To test the same followed procedure
1) Setup brick mux environment on a vm
2) Put a breaking point in gdb in function posix_health_check_thread_proc
at the time of notify GF_EVENT_CHILD_DOWN event
3) unmount anyone brick path forcefully
4) check gluster v status it will show N/A for the brick
5) Try to start volume with force option, glusterd throw
message "No device available for mount brick"
6) Mount the brick_root path
7) Try to start volume with force option
8) down brick is started successfully
Change-Id: I91898dad21d082ebddd12aa0d1f7f0ed012bdf69
fixes: bz#1595320
Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
| |
This patch fixes coverity issues 102, 103, 112 and 119 from [1]
[1] https://download.gluster.org/pub/gluster/glusterfs/static-analysis/master/glusterfs-coverity/2018-07-23-5fa004f3/html/
Updates: bz#789278
Change-Id: I99762eb0bcbd974a5250434777db63520f2ce2e6
Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch will fix coverity issue 74 from [1].
we are updating ret value line number 5011, and
immediately checking whether ret is having non
zero value at line number 5013.If ret is 0, then
only we continue to execute and we can reach line
number 5036. By the time we reach 5036, ret value
is always 0. So this block of code is redundant
here and removing it.
[1] https://download.gluster.org/pub/gluster/glusterfs/static-analysis/master/glusterfs-coverity/2018-07-23-5fa004f3/html/
Updates: bz#789278
Change-Id: Ia6e8ba2936e350f0d29a9151ab786622f5e750db
Signed-off-by: Oshank Kumar <okumar@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently this lru limit is hard-coded to 16384. This patch makes it
configurable to make it easier to hit the lru limit and enable testing
of different cases that arise when the limit is reached.
The option is features.shard-lru-limit. It is by design allowed to
be configured only in init() but not in reconfigure(). This is to avoid
all the complexity associated with eviction of least recently used shards
when the list is shrunk.
Change-Id: Ifdcc2099f634314fafe8444e2d676e192e89e295
updates: bz#1605056
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem : In 'glusterd_verify_slave' while tokenizing error message
we call 'strtok_r' and store return value in 'tmp' which
can be NULL. We are passing this 'tmp' as 1st argument to
'strcmp' which will lead to segmentation fault.
Solution : before calling 'strcmp' we should NULL check 'tmp'.
Change-Id: Ifd3864b904afe6cd09d9e5a4b55c6d0578e22b9d
fixes: bz#1602121
Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Please review, it's not always just the comments that were fixed.
I've had to revert of course all calls to creat() that were changed
to create() ...
Only compile-tested!
Change-Id: I7d02e82d9766e272a7fd9cc68e51901d69e5aab5
updates: bz#1193929
Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
|
|
|
|
|
|
|
|
|
| |
See https://download.gluster.org/pub/gluster/glusterfs/static-analysis/master/glusterfs-coverity/2018-07-13-1718f9c6/html/1/6glusterd-quota.c.html#error
Only compile tested!
Change-Id: Ief42f9fcdb02ad001bd39c4a6e27e7fa86fd2496
updates: bz#1193929
Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: gluster get-state command is leaking the memory when
geo-replication session is configured.
Cause: In glusterd_print_gsync_status(), we are trying to get
reference to the keys of gsync_dict. The references to keys of
gsync_dict are stored status_vols[i]. status_vols[i] are
allocated with a memory of size of gf_gsync_status_t.
Solution: Need not to use a array of pointers(status_vals), using
a pointer to hold the reference to a key of gsync_dict is sufficient.
Followed the below steps for testing:
1. Configured geo-rep session
2. Ran gluster get-state command for 1000 times.
Without this patch, glusterd's memory was increasing significantly
(around 22000KB per 1000 times), with this patch it reduced (1500KB
per 1000 times)
fixes: bz#1601423
Change-Id: I361f5525d71f821bb345419ccfdc20ca288ca292
Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
|
|
|
|
|
|
|
|
|
| |
The same variable 'len' was used both in the macros and the functions.
(Introduced as part of commit 6dc5dfef819cad69d6d4b4c1c305efa74236ad84 ?)
Change-Id: If434999d6470067f8a1e501c8e132561e8cd81ef
updates: bz#1193929
Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
|