summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Contributing: update about who can trigger the buildHEADmasterAmar Tumballi2020-10-071-3/+4
| | | | | | | | | Currently only maintainers listed in github group can trigger the regression runs, it may change in future! Updates: #1000 Change-Id: I3b5f1cace8a433886d725539198998875dcdce36 Signed-off-by: Amar Tumballi <amar@kadalu.io>
* Migration: update the docsAmar Tumballi2020-10-075-56/+160
| | | | | | | | | | | * Make CONTRIBUTING.md have complete workflow documented. * Change './rfc.sh' to reflect the new workflow Updates: #1000 Also Updates: gluster/project-infrastructure#62 Change-Id: I31becd7cdb35cb68048b662786c31694791d50fe Signed-off-by: Amar Tumballi <amar@kadalu.io>
* DHT - Removing commit hash and 'magical' return value from rebalanceBarak Sason Rofman2020-10-071-26/+7
| | | | | | | | | | | | | | | | | | | The order of operation in rebalance is as follows: gf_defrag_fix_layout - > gf_defrag_process_dir - > gf_defrag_get_entry gf_defrag_process_dir is passing to gf_defrag_get_entry a pointer to a variable 'gf_defrag_get_entry', however this value is ignored (remains unchanged in the method). Based on the return value from gf_defrag_get_entry, gf_defrag_process_dir may change it's return value to the 'magical' number 2, however since the value of 'should_commit_hash' never changes, this never happnes. All of this is propagated back to gf_defrag_fix_layout and is now removed from there as well. Change-Id: Ibff297650cf84139bd26c830bfa44f81119b60d4 updates: #1002 Signed-off-by: Barak Sason Rofman <bsasonro@redhat.com>
* mount/fuse: Fix graph-switch when reader-thread-count is setPranith Kumar K2020-10-052-8/+68
| | | | | | | | | | | | | | Problem: The current graph-switch code sets priv->handle_graph_switch to false even when graph-switch is in progress which leads to crashes in some cases Fix: priv->handle_graph_switch should be set to false only when graph-switch completes. fixes: #1539 Change-Id: I5b04f7220a0a6e65c5f5afa3e28d1afe9efcdc31 Signed-off-by: Pranith Kumar K <pranith.karampuri@phonepe.com>
* dht - Remove "tier" code (part 2)Barak Sason Rofman2020-10-019-515/+81
| | | | | | | | | | | | | | Part 1 of this patch https://review.gluster.org/#/c/glusterfs/+/24328/ Following part 1, this patch complety removes all traces of "tier" feature in dht. This is based in the work done in https://review.gluster.org/#/c/glusterfs/+/23935/ Change-Id: I7fba1ab7249719301ca578b4a6f4acac748da145 updates: #1097 Signed-off-by: Barak Sason Rofman <bsasonro@redhat.com>
* fixed AFR_READ_POLICY_GFID_PID_HASH policy bugperrynzhou2020-10-011-1/+2
| | | | | | Change-Id: Ib927a770a486c95e4b157e76ba96e9904d1a9716 Fixes: #1499 Signed-off-by: perrynzhou <perrynzhou@gmail.com>
* cluster/afr: Heal directory rename without rmdir/mkdirPranith Kumar K2020-10-0120-128/+1427
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem1: When a directory is renamed while a brick is down entry-heal always did an rm -rf on that directory on the sink on old location and did mkdir and created the directory hierarchy again in the new location. This is inefficient. Problem2: Renamedir heal order may lead to a scenario where directory in the new location could be created before deleting it from old location leading to 2 directories with same gfid in posix. Fix: As part of heal, if oldlocation is healed first and is not present in source-brick always rename it into a hidden directory inside the sink-brick so that when heal is triggered in new-location shd can rename it from this hidden directory to the new-location. If new-location heal is triggered first and it detects that the directory already exists in the brick, then it should skip healing the directory until it appears in the hidden directory. Credits: Ravi for rename-data-loss.t script Fixes: #1211 Change-Id: I0cba2006f35cd03d314d18211ce0bd530e254843 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
* build: drop -rdynamic from compiler flagsDmitry Antipov2020-10-011-1/+1
| | | | | | | | | Since -rdynamic is meaningless during compilation, drop it from GF_CFLAGS. Note GF_LDFLAGS unconditionally use -rdynamic anyway. Change-Id: I07c7086a8a6adad8358b88999d98828c1cbfb464 Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru> Updates: #1002
* DHT - Fixing memory allocation crashBarak Sason Rofman2020-10-011-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | The allocation dir_dfmeta = GF_CALLOC(1, sizeof(*dir_dfmeta), gf_common_mt_pointer); seems to cause a crash. From the logs: [2020-09-24 13:10:13.225935 +0000] I [dht-rebalance.c:3273:gf_defrag_process_dir] 0-dist-dht: migrate data called on /dir1 [2020-09-24 13:10:13.226587 +0000] E [mem-pool.c:61:gf_mem_set_acct_info] (-->/usr/local/lib/glusterfs/9dev/xlator/cluster/distribute.so(+0x18e60) [0x7f4b1f71ee60] -->/usr/local/lib/glusterfs/9dev/xlator/cluster/distribute.so(+0x173ab) [0x7f4b1f71d3ab] -->/usr/local/lib/libglusterfs.so.0(+0x4d8e5) [0x7f4b357668e5] ) 0-: Assertion failed: type <= mem_acct->num_types [2020-09-24 13:10:13.226623 +0000] E [mem-pool.c:61:gf_mem_set_acct_info] (-->/usr/local/lib/glusterfs/9dev/xlator/cluster/distribute.so(+0x18e60) [0x7f4b1f71ee60] -->/usr/local/lib/glusterfs/9dev/xlator/cluster/distribute.so(+0x173d3) [0x7f4b1f71d3d3] -->/usr/local/lib/libglusterfs.so.0(+0x4d8e5) [0x7f4b357668e5] ) 0-: Assertion failed: type <= mem_acct->num_types The following change fixes that crash. fixes: #1511 Change-Id: Ibf605648981f7108e863c91a80370cf077ad7c4a Signed-off-by: Barak Sason Rofman <bsasonro@redhat.com>
* bitrot/stub: Fix memory leak gf_br_stub_mt_version_tMohammed Rafi KC2020-09-302-31/+42
| | | | | | | | | | The data type gf_br_stub_mt_version_t is leaking because the data type has been added to the dict as static type and the memory is not free'd from anywhere else Change-Id: Ib10134f41f45a39be849af1708b1960c77fb62fd Fixes: #1427 Signed-off-by: Mohammed Rafi KC <rafi.kavungal@iternity.com>
* MAINTAINERS: Changing communication emailMohammed Rafi KC2020-09-301-5/+5
| | | | | | Change-Id: I5ae3161d0357ddd62fb6409933837ffd94610d83 Updates: #1002 Signed-off-by: Mohammed Rafi KC <rafi.kavungal@iternity.com>
* gfapi: Move the SECURE_ACCESS_FILE check out of glfs_mgmt_initMôshe van der Sterre2020-09-295-5/+223
| | | | | | | | glfs_mgmt_init is only called for glfs_set_volfile_server, but secure_mgmt is also required to use glfs_set_volfile with SSL. fixes: #829 Change-Id: Ibc769fe634d805e085232f85ce6e1c48bf4acc66
* dht: explicit null dereferencenik-redhat2020-09-292-0/+4
| | | | | | | | | | | | | | Added a null check for uuid_list_copy, to avoid null dereference in strtok_r() in case of strdup() failure. CID: 1325612 CID: 1274223 Updates: #1060 Change-Id: I641a5068cd76d7b2ed92eccf39e7f97d6f7b2480 Signed-off-by: nik-redhat <nladha@redhat.com>
* locks: null dereferencenik-redhat2020-09-291-0/+3
| | | | | | | | | | | Added a null check before executing the strtok_r() to avoid null dereference in case of strdup() failure. CID: 1407938 Updates: #1060 Change-Id: Iec6e72ae8cb54f6d0a287615c43756325b2026ec Signed-off-by: nik-redhat <nladha@redhat.com>
* glusterd: start the brick on a different portSanju Rakonde2020-09-291-0/+3
| | | | | | | | | | | | | | | | | | | | | Problem: brick fails to start when the port provided by glusterd is in use by any other process Solution: glusterd should check errno set by runner_run() and if it is set to EADDRINUSE, it should allocate a new port to the brick and try to start it again. Previously ret value is checked instead of errno, so the retry part never executed. Now, we initialize errno to 0 before calling runner framework. and afterwards store the errno into ret to avoid modification of errno in subsequent function calls. fixes: #1101 Change-Id: I1aa048a77c5f8b035dece36976d60602d9753b1a Signed-off-by: Sanju Rakonde <srakonde@redhat.com> Signed-off-by: nik-redhat <nladha@redhat.com>
* MAINTAINERS: Changing communication emailpranith.karampuri2020-09-291-8/+8
| | | | | | Updates: #1002 Change-Id: I1b8fb6430a6a64fc813bdd111a31b3574ffc06a1 Signed-off-by: Pranith Kumar K <pranith.karampuri@phonepe.com>
* glusterd: Replacing str with ptr in strchr to reduce comparisonsrijan-sivakumar2020-09-281-1/+1
| | | | | | | | | | | | | | | Issue: On seeing the function glusterd_replace_slash_with_hyphen we see that the strchr inside the while loop takes str as a parameter, that'd mean repeated comparison from index 0 of str even though the characters have already been compared. Why not use ptr instead which points to the latest replacement in the string. Code change: replacing str with ptr inside the strchr function. Fixes: #1516 Change-Id: Id049ec2ad9800a01730f2a0263d9e0528557ae81 Signed-off-by: srijan-sivakumar <ssivakum@redhat.com>
* dht: Ongoing IO is failing on non-distribute volumes after just add-brickMohit Agrawal2020-09-283-8/+41
| | | | | | | | | | | | | Problem: On a non-distributed volumes linux kernel untar is failed after running add-brick operation Solution: 1) Save hashed subvol as a MDS in case while MDS has not been populated Fixes: #1328 Change-Id: I9967e136da008c6367973a7346637617dfa8f934 Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
* glusterd: resource leaksnik-redhat2020-09-251-2/+1
| | | | | | | | | | | | | | Issue: iobref was not freed before exiting the function. Fix: Modified the code to free iobref before exiting. CID: 1430107 Updates: #1060 Change-Id: I89351b3aa645792eb8dda6292d1e559057b02d8b Signed-off-by: nik-redhat <nladha@redhat.com>
* gfapi: Check the fd argument before accessing itXavi Hernandez2020-09-252-0/+75
| | | | | | | | | | | Some public GFAPI functions did access the fd object without verifying that it wasn't NULL, causing crashes in some cases. This patch returns an error code in case it's NULL. Updates: #1009 Change-Id: I8cadde87ae8d542e0af9b55aa866fe763f97d4fb Signed-off-by: Xavi Hernandez <xhernandez@redhat.com>
* DHT - fixing a bug in thread creationBarak Sason Rofman2020-09-241-2/+2
| | | | | | | | | | The 3rd argument of gf_thread_create is a pointer to a method, however in this case, a pointer to a pointer to a method is passed (2 levels of indirection instead of 1). Change-Id: Ic2d4ea75aa54c6bc85a80bd0277a0efa5e5814ad updates: #1002 Signed-off-by: Barak Sason Rofman <bsasonro@redhat.com>
* glusterd: Fix Add-brick with increasing replica count failureSheetal Pamecha2020-09-242-0/+25
| | | | | | | | | | | | | Problem: add-brick operation fails with multiple bricks on same server error when replica count is increased. This was happening because of extra runs in a loop to compare hostnames and if bricks supplied were less than "replica" count, the bricks will get compared to itself resulting in above error. Fixes: #1508 Change-Id: I8668e964340b7bf59728bb838525d2db062197ed Signed-off-by: Sheetal Pamecha <spamecha@redhat.com>
* build: when building with tirpc, link with libtirpcKaleb S. KEITHLEY2020-09-242-2/+3
| | | | | | | | | | | | | uncovered on Ubuntu Groovy (20.10, ubuntu's bleeding edge devel dist), seems to now have stricter link semantics than it did when we last built 8.1 and 7.5. Many xlators actually do have direct calls to xdr_sizeof(), so strictly speaking they should be linked with libtirpc. Change-Id: Iee1fd3528fde19db397c4eae6978d9b9a2c3e17f Updates: #1002 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
* glusterd: Removing strlen and using existing len field of data_tsrijan-sivakumar2020-09-241-3/+5
| | | | | | | | | | | | | | Issue: The strlen being used to find the length of the dictionary is an extra step as there already exists len field in data_t which contains the same value. Code Change : 1. Replacing the strlen with len. 2. Removing a typecast which wasn't required. Fixes: #1497 Change-Id: I2780c3876b17b8825038d222fb489a87e090411f Signed-off-by: srijan-sivakumar <ssivakum@redhat.com>
* glusterd: Fixing coverity issues.srijan-sivakumar2020-09-241-4/+2
| | | | | | | | | | | Fixing Incorrect expression (IDENTICAL_BRANCHES) reported by the coverity scan. CID: 1432721 Change-Id: If6ab3a129dffb6c5fcc618e775f99bc1125003ab Updates: #1060 Signed-off-by: srijan-sivakumar <ssivakum@redhat.com>
* nfs: test case bugs_nfs_bug-1116503.t is crashedMohit Agrawal2020-09-233-3/+9
| | | | | | | | | | | | test case is crashed because GF_ASSERT is failing in gf_mem_set_acct_info function due to access global xlator instead of accessing nfs xlator.To avoid the crash pass nfsx at the time of calling nsm_thread to set the THIS. Fixes: #1506 Change-Id: Ifd8afcdf39578aa44332d1b79744a4e9910fe7c6 Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
* cluster/ec: Track heal statistics in shdPranith Kumar K2020-09-223-1/+59
| | | | | | | | | With this change we should be able to inspect number of heals attempted and completed by each shd. fixes: #1453 Change-Id: I10f5d86efcc0a8e4d648da808751d37725682c39 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
* glusterd: add post-commit phase to the transactionSanju Rakonde2020-09-2110-1/+587
| | | | | | | | | | | | | | | | This is part 2 of the fix. part 1 is at https://review.gluster.org/#/c/glusterfs/+/24325/ This patch adds post commit phase to the mgmt v3 transaction framework. In post commit phase we replace the old auth.allow list in case of add-brick and replace-brick. fixes: #1391 Change-Id: I41c871d59e6252d27163b042ad710e929d7d0399 Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* glusterd: mount directory getting truncated on mounting shared_storagenik-redhat2020-09-201-1/+2
| | | | | | | | | | | | | | | | | | | | | | | Issue: In case of a user created volume the mount point is the brick path 'ex: /data/brick' but in case of shared_storage the mount point is '/'.So, here we increment the array by one so as to get the exact path of brick without '/', which works fine for other volumes as the pointer of the brick_dir variable is at '/', but for shared_storage it is at 'v'(where v is starting letter of 'var' directory). So, on incrementing the path we get in case of shared_storage starts from 'ar/lib/glusterd/...' Fix: Only, increment the pointer if the current position is '/', else the path will be wrong. Fixes: #1480 Change-Id: Id31bb13f58134ae2099884fbc5984c4e055fb357 Signed-off-by: nik-redhat <nladha@redhat.com>
* glusterd:Reducing file operations when writing options into volfile.Srijan Sivakumar2020-09-174-91/+140
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue: The options to be written into the volfile are in form of key-value pairs and the current approach taken to write them into a file is to invoke the write syscall for each key-value pair. This implies an increased number of system calls. Code Changes: 1. Addition of a structure, glusterd_volinfo_data_store_t in glusterd-store.h, containing a character buffer, a pointer to gf_store_handle_t, the current length of data in the buffer as well as a flag for checking key while storing in the buffer. This is used for passing the required file descriptor as well having a character buffer for storing multiple options before being written into a file. 2. Modification of function, _storeopts in glusterd-store.c, which now invokes the gf_store_save_items when buffer is to be emptied into the volfile before further write into it. Also, it has replaced the function _storeslaves, _gd_store_rebalance_dict and _store_global_opts. 3. Modification of function, glusterd_store_volinfo_write in glusterd-store.c, wherein a pointer of type glusterd_volinfo_data_store_t is initialized for further operation. Also, the buffer is emptied into the volfile before it is freed. 4. Modification of function, glusterd_store_node_state_write in glusterd-store.c, wherein the a pointer of type glusterd_volinfo_data_store_t is initialized for further operations. Also, the buffer is emptied into the volfile before it is freed. 5. Addition of enum into glusterd-mem-types.h 6. Modification of function, glusterd_store_options in glusterd-store.c, wherein a pointer of type glusterd_volinfo_data_store_t is initialized for further opertaions. Also, the buffer is emptied into the volfile before it is freed. Reasoning behind the approach: 1.Instead of a dynamic allocation of buffer or increasing the buffer size with increased number of options, it, the current approach takes a buffer of fixed size (VOLINFO_BUFFER_SIZE). Before any write into the buffer, the size is checked and if it exceeds the available space, the contents of the buffer are written to the file before copying new contents. Dynamic allocation can lead to increased memory usage as one doesn't know the number of options that could be added in time and may go on to occupy more space than mandated. 2.The function dict_foreach is a generic function used across different modules. It made sense not to change its implementation as it might affect other Functionalities. Hence a structure was added which could just be passed as one of the parameter to this function (as it takes a void*). 3. Reduced number of system calls implies an increase in execution speed. Also, these modified functions come into play whenever the volume is started or modified. 4. The functions _storeslaves, _gd_store_rebalace_dict and _store_global_opts were doing the same set of operations as that of _storeopts except the checking for the key. This has been handled with the help of a flag in the glusterd_volinfo_data_store_t structure. This reduces the duplicate code present. Signed-off-by: Srijan Sivakumar <ssivakum@redhat.com> Change-Id: I22e6e91c78ed51e3a171482054d77bf793b9ab16 Fixes: #718
* quota_fsck.py fails with UnicodeDecodeErrorsrijan-sivakumar2020-09-161-5/+2
| | | | | | | | | | | | | | | | | | Issue: While decoding the byte characters the quota_fsck script stumbled across a corner case wherein the file names given by the getfattr dump will cause the decoding to UTF-8 to fail with UnicodeDecodeError. Code Change: On looking through the quota_fsck.py script, it seems like the file path is actually not needed when decoding for the xattr parsing, hence the code change reflects that. Also, removed a comparison which previously existed to skip the file names as that won't be required now. Fixes: #1487 Change-Id: I8a13ab07be6c9cfafae996f17764fbb4a285bd8c Signed-off-by: srijan-sivakumar <ssivakum@redhat.com>
* nfs: Use static api to set static data in dictPranith Kumar K2020-09-141-2/+1
| | | | | | fixes: #1477 Change-Id: I8b9f76887f4617f82d09291205e28e3fb5ddc8e0 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
* glusterd: readdir-ahead off by defaultnik-redhat2020-09-141-1/+1
| | | | | | | | | | | | Changing the default value of readdir-ahead to off, but it can be enabled/disabled later on if with gluster vol set <volname> performance.readdir-ahead enabel/disable command. Fixes: #1472 Change-Id: Idb3e16e8be98d7a811fc8e5d09906919ef50fbab Signed-off-by: nik-redhat <nladha@redhat.com>
* glusterd: fixing coverity issuesnik-redhat2020-09-111-3/+9
| | | | | | | | | | | | | | | In the last patch merge for the performance.readdir -ahead dependencies, there was few issues with return check and NULL derefencing. So, fixed that as per the coverity scanner. CID: 1432493 CID: 1432492 Updates: #1060 Change-Id: I6dee6d35ef41ab8d6322f1b2e3734c4796ee2804 Signed-off-by: nik-redhat <nladha@redhat.com>
* nfs-ganesha: gluster_shared_storage fails to automount on node reboot on rhel 8Shwetha K Acharya2020-09-103-3/+3
| | | | | | | | | | | | | | The patch https://review.gluster.org/#/c/glusterfs/+/24934/, changes mount point of gluster_shared_storage from /var/run to /run to address the issue of symlink at mount path in fstab. NOTE: mount point /var/run is symlink to /run The required changes with respect to gluster_shared_storage mount path are introduced with this patch in nfs-ganesha. Fixes: #1475 Change-Id: I9c7677a053e1291f71476d47ba6fa2e729f59625 Signed-off-by: Shwetha K Acharya <sacharya@redhat.com>
* extras/snap_scheduler: changes in gluster-shared-storage mount path Shwetha K Acharya2020-09-102-3/+3
| | | | | | | | | | | | | | The patch https://review.gluster.org/#/c/glusterfs/+/24934/, changes mount point of gluster_shared_storage from /var/run to /run to address the issue of symlink at mount path in fstab. NOTE: mount point /var/run is symlink to /run The required changes with respect to gluster_shared_storage mount path are introduced with this patch in snap_scheduler. Fixes: #1476 Change-Id: I9ce88c2f624c6aa5982de04edfee2d0a9f160d62 Signed-off-by: Shwetha K Acharya <sacharya@redhat.com>
* geo-rep: gluster_shared_storage fails to automount on node reboot on rhel 8.Shwetha K Acharya2020-09-102-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | Issue: On reboot, all the mounts get wiped out. Only the mounts mentioned in /etc/fstab automatically gets mounted during boot/reboot. But /etc/fstab complains on not getting a canonical path (it gets path containing a symlink) This is because the gluster_shared_storage, is mounted to /var/run which is symlink to /run. This is a general practice followed by most operating systems. [root@ ~]# ls -lsah /var/run 0 lrwxrwxrwx. 1 root root 6 Jul 22 19:39 /var/run -> ../run Fix: Mount gluster_shared_storage on /run. (Also It is seen that /var/run is mostly used by old or legacy systems, thus it is a good practice to update /var/run to /run) fixes: #1459 Change-Id: I8c16653be8cd746c84f01abf0eea19284fb97c77 Signed-off-by: Shwetha K Acharya <sacharya@redhat.com>
* glusterd: automatically turn on dependencies for parallel-readdirnik-redhat2020-09-081-2/+5
| | | | | | | | | | | | | | | | | | | Issue: On setting the performance.parallel-readdir to "on" the dependencies of it should automatically be turned on and readdir-ahead should be the parent of each dht subvolume. Fix: On enabling the parallel-readdir, the dependencies are turned on by enabling readdir-ahead simultaneously, and readdir-ahead will be seen as the parent of each dht subvolume. Fixes: #1416 Change-Id: Ic83ae470152b88edddc274d5e6c4d74169d23c15 Signed-off-by: nik-redhat <nladha@redhat.com>
* rpcsvc: Add latency tracking for rpc programsPranith Kumar K2020-09-0714-69/+193
| | | | | | | | | | Added latency tracking of rpc-handling code. With this change we should be able to monitor the amount of time rpc-handling code is consuming for each of the rpc call. fixes: #1466 Change-Id: I04fc7f3b12bfa5053c0fc36885f271cb78f581cd Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
* xlators: prefer libglusterfs time APIDmitry Antipov2020-09-0716-72/+40
| | | | | | | | | | Prefer timespec_now_realtime() and gf_time() over clock_gettime() and time(), use gf_tvdiff() and gf_tsdiff() where appropriate, drop unused time_elapsed() and leftovers in 'struct posix_private'. Change-Id: Ie1f0229df5b03d0862193ce2b7fb91d27b0981b6 Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru> Updates: #1002
* open-behind: implement create fopXavi Hernandez2020-09-071-0/+52
| | | | | | | | | | | | | | Open behind didn't implement create fop. This caused that files created were not accounted for the number of open fd's. This could cause future opens to be delayed when they shouldn't. This patch implements the create fop. It also fixes a problem when destroying the stack: when frame->local was not NULL, STACK_DESTROY() tried to mem_put() it, which is not correct. Fixes: #1440 Change-Id: Ic982bad07d4af30b915d7eb1fbcef7a847a45869 Signed-off-by: Xavi Hernandez <xhernandez@redhat.com>
* glusterfsd, libglusterfs, rpc: prefer libglusterfs time APIDmitry Antipov2020-09-074-7/+7
| | | | | | | | Use timespec_now_realtime() rather than clock_gettime(). Change-Id: I8fa00b7c0f7b388305c7d19574be3b409db68558 Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru> Updates: #1002
* build: extend --enable-valgrind to support Memcheck and DRDDmitry Antipov2020-09-0512-41/+140
| | | | | | | | | Extend '-enable-valgrind' to '--enable=valgrind[=memcheck,drd]' to enable Memcheck or DRD Valgrind tool, respectively. Change-Id: I80d13d72ba9756e0cbcdbeb6766b5c98e3e8c002 Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru> Updates: #1002
* libglusterfs: fix dict leakRavishankar N2020-09-044-10/+30
| | | | | | | | | | | | | | Problem: gf_rev_dns_lookup_cached() allocated struct dnscache->dict if it was null but the freeing was left to the caller. Fix: Moved dict allocation and freeing into corresponding init and fini routines so that its easier for the caller to avoid such leaks. Updates: #1000 Change-Id: I90d6a6f85ca2dd4fe0ab461177aaa9ac9c1fbcf9 Signed-off-by: Ravishankar N <ravishankar@redhat.com>
* glusterd: use after free (coverity issue)nik-redhat2020-09-041-2/+3
| | | | | | | | | | | | | | | | | | Issue: dict_unref is called on the same dict again, in the out label of the code, which causes the use after free issue. Fix: Set the dict to NULL after unref, to avoid use after free issue. CID: 1430127 Updates: #1060 Change-Id: Ide9a5cbc5f496705c671e72b0260da6d4c06f16d Signed-off-by: nik-redhat <nladha@redhat.com>
* glusterd: cksum mismatch on upgrading to latest glusternik-redhat2020-09-041-0/+9
| | | | | | | | | | | | | | | | | | | | | | Issue: In gluster versions less than 7, the checksums were calculated whether or not the quota is enabled or not, and that cksum value was also getting stored in the quota.cksum file. But, from gluster 7 version onwards cksum was calculated only if the quota is enabled. Due to this, the cksums in quota.cksum files differ after upgrading. Fix: Added a check to see if the OP_VERSION is less than 7 then, follow the previous method otherwise, move as per the latest changes for cksum calculation. This changes for the cksum calculation was done in this commit : https://github.com/gluster/glusterfs/commit/3b5eb592f5 Fixes: #1332 Change-Id: I7a95e5e5f4d4be4983fb7816225bf9187856c003 Signed-off-by: nik-redhat <nladha@redhat.com>
* core: Avoid dict OR key is NULL message in brick logsMohit Agrawal2020-09-041-1/+1
| | | | | | | | | | | | | | Problem: At the time of mount a volume server_first_lookup call's syncop_lookup with a NULL xattr so index_lookup is throwing a message at the time of fetching "link-count" from a dictionary Solution: Call dict_get_str_sizen instead of calling dict_get_str to avoid a warning message Fixes: #1464 Change-Id: I2b1ee3123ab817fa09f3abe39998c0d66ac0b824 Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
* cluster/ec: Don't trigger heal for stale indexPranith Kumar K2020-09-041-0/+1
| | | | | | Fixes: #1385 Change-Id: I3609dd2e1f63c4bd6a19d528b935bf5b05443824 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
* build: Added dependency for glusterfs-selinuxRinku Kothiya2020-09-031-0/+3
| | | | | | | Fixes: #1442 Change-Id: I7d79bceff329db4d525bc8a77ba7ffe41bf53c97 Signed-off-by: Rinku Kothiya <rkothiya@redhat.com>
* Events: Fixing coverity issues.Srijan Sivakumar2020-09-031-3/+5
| | | | | | | | | | Fixing resource leak reported by coverity scan. CID: 1431237 Change-Id: I2bed106b3dc4296c50d80542ee678d32c6928c25 Updates: #1060 Signed-off-by: Srijan Sivakumar <ssivakum@redhat.com>