summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* glusterfind: python3 compatibilitySunny Kumar2020-01-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Problem: While we delete gluster volume the hook script 'S57glusterfind-delete-post.py' is failed to execute and error message can be observed in glusterd log. Traceback: File "/var/lib/glusterd/hooks/1/delete/post/S57glusterfind-delete-post", line 69, in <module> main() File "/var/lib/glusterd/hooks/1/delete/post/S57glusterfind-delete-post", line 39, in main glusterfind_dir = os.path.join(get_glusterd_workdir(), "glusterfind") File "/usr/lib64/python3.7/posixpath.py", line 94, in join genericpath._check_arg_types('join', a, *p) File "/usr/lib64/python3.7/genericpath.py", line 155, in _check_arg_types raise TypeError("Can't mix strings and bytes in path components") from None TypeError: Can't mix strings and bytes in path components Solution: Added the 'universal_newlines' flag to Popen to support backward compatibility. Change-Id: Ie5655b11b55535c5ad2338108d0448e6fdaacf4f Fixes: bz#1789478 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
* glusterfind: Fix py2/py3 issuesKotresh HR2020-01-102-9/+13
| | | | | | | | | | | 1. In dictionary values(), returns list in py2 and not in py3. So explicitly convert it into list. 2. xattr module returns values in bytes. So explicitly convert them to str to work both with py2 and py3 fixes: bz#1789439 Change-Id: I27a639cda4f7a4ece9744a97c3d16e247906bd94 Signed-off-by: Kotresh HR <khiremat@redhat.com>
* dht-rename.c: fix Coverity issues 1397018/7 - strcat into uninitialized valueYaniv Kaul2020-01-101-0/+4
| | | | | | | | | initialize both src and dst if they were not initialized already. fixes: CID#1397018 Change-Id: Ic91954423953e8bf24eaa11fc2798c554f304d28 updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
* multiple: fix bad type castXavi Hernandez2020-01-106-21/+42
| | | | | | | | | | | | When using inode_ctx_get() or inode_ctx_set(), a 'uint64_t *' is expected. In many cases, the value to retrieve or store is a pointer, which will be of smaller size in some architectures (for example 32-bits). In this case, directly passing the address of the pointer casted to an 'uint64_t *' is wrong and can cause memory corruption. Change-Id: Iae616da9dda528df6743fa2f65ae5cff5ad23258 Signed-off-by: Xavi Hernandez <xhernandez@redhat.com> Fixes: bz#1785611
* fuse: degrade logging of write failure to fuse deviceCsaba Henk2020-01-092-7/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | Problem: FUSE uses failures of communicating with /dev/fuse with various errnos to indicate in-kernel conditions to userspace. Some of these shouldn't be handled as an application error. Also the standard POSIX errno description should not be shown as they are misleading in this context. Solution: When writing to the fuse device, the caller of the respective convenience routine can mask those errnos which don't qualify to be an error for the application in that context, so then those shall be reported at DEBUG level. The possible non-standard errnos are reported with their POSIX name instead of their description to avoid confusion. (Eg. for ENOENT we don't log "no such file or directory", we log indeed literal "ENOENT".) Change-Id: I510158843e4b1d482bdc496c2e97b1860dc1ba93 updates: bz#1193929 Signed-off-by: Csaba Henk <csaba@redhat.com>
* leases: re-alignment of structuresPurna Pavan Chandra Aekkaladevi2020-01-091-15/+20
| | | | | | | | | | | | | | | All the structs present inside xlators/features/leases have been re-aligned into memory efficient way. Changes are made in such a way that every members are 8 byte aligned and no padding is left out in the 8 byte line. Manual padding has been added to remove compile time padding (which happens at the end of the struct). This manual padding is for development and debugging benefits. It lets to use -Wpadded option and raise warnings from the remaining structs where compile time padding happens. Change-Id: I083d2de80e24f363c97adadcba64825e213050fc Updates: bz#1754448 Signed-off-by: Purna Pavan Chandra Aekkaladevi <paekkala@redhat.com>
* glusterd: increase the StartLimitBurstSanju Rakonde2020-01-081-1/+1
| | | | | | | | | | Based on https://bugzilla.redhat.com/show_bug.cgi?id=1782200#c6 increasing the limit. fixes: bz#1782200 Change-Id: Ia885c7bdb2a90f0946c5268da894f6a4da5a69b7 Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* afr: expose cluster.optimistic-change-log to CLI.Ravishankar N2020-01-073-0/+8
| | | | | | | | | | | This volume option was not made avaialble to `gluster volume set` CLI. Reported-by: epolakis(https://github.com/kinsu) in https://github.com/gluster/glusterfs/issues/781 fixes: bz#1787554 Change-Id: I7141bdd4e53ee99e22b354edde8d023bfc0b2cd7 Signed-off-by: Ravishankar N <ravishankar@redhat.com>
* cli - fixing a coverity issueBarak Sason Rofman2020-01-071-1/+1
| | | | | | | | | | Removed unused variable. fixes: CID#1412106 updates: bz#789278 Change-Id: I1d4e1c1625cecf882d51e9cf4f5290383f63d405 Signed-off-by: Barak Sason Rofman <bsasonro@redhat.com>
* mgmt/glusterd: Correct the log path of valgrind.He Min2020-01-061-1/+1
| | | | | | | | | | | | | | | | | Problem: Currently enabling run-with-valgrind will cause the gnfs and quota to fail to start. The phenomenon is as follows. ------------------------------------------------------------------------------ NFS Server on localhost 2049 0 N 48406 Quota Daemon on localhost N/A N/A N 48428 ------------------------------------------------------------------------------ Solution: The cause of the above phenomenon is that the log path of valgrind is set incorrectly. Gnfs and quota can start with valgrind normally after correcting the log path. Updates: #788 Change-Id: Ib91408c08522ff66afff908fbff3fce4b93ea770 Signed-off-by: He Min <hemin@cmss.chinamobile.com>
* xlator/performance/io-threads: structure loggingyatipadia2020-01-062-23/+33
| | | | | | | convert gf_msg() to gf_smsg() Change-Id: I35c6f62c346a75ecb22cd3a4346ad4dc48f09a91 Updates: #657
* xlator/io-cache: structure loggingyatipadia2020-01-064-100/+112
| | | | | | | | | Convert all gf_msg() to gf_smsg() Updates: #657 Change-Id: I72215b2518df78174dda8a7bc8de6f21fe1ba10f Signed-off-by: yatipadia <ypadia@redhat.com>
* posix-metadata.c: try to getxattr in one call.Yaniv Kaul2020-01-061-48/+61
| | | | | | | | | | | | | | | | | Another location where instead of 2 sys calls we strive to get the xattr in a single call, by guesstimating the required size And avoid (or try to) not to first read the xattr len, then another call to actually fetch. Instead, use a sane size (256 bytes - worth checking if it makes sense or by default use a larger size), and see if we can fetch it. If we fail, we'll read the size and re-fetch. Such changes are needed elsewhere too (see https://github.com/gluster/glusterfs/issues/720 ) Change-Id: I466cea9d8b12fc45f6b37d202b1294ca28cd1fdd updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
* cli: duplicate defns of cli_default_conn_timeout and cli_ten_minutes_timeoutKaleb S. KEITHLEY2020-01-062-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Winter is coming. So is gcc-10. Compiling with gcc-10-20191219 snapshot reveals dupe defns of cli_default_conn_timeout and cli_ten_minutes_timeout in .../cli/src/cli.[ch] due to missing extern decl. There are many changes coming in gcc-10 described in https://gcc.gnu.org/gcc-10/changes.html compiling cli.c with gcc-9 we see: ... .quad .LC88 .comm cli_ten_minutes_timeout,4,4 .comm cli_default_conn_timeout,4,4 .text .Letext0: ... and with gcc-10: ... .quad .LC88 .globl cli_ten_minutes_timeout .bss .align 4 .type cli_ten_minutes_timeout, @object .size cli_ten_minutes_timeout, 4 cli_ten_minutes_timeout: .zero 4 .globl cli_default_conn_timeout .align 4 .type cli_default_conn_timeout, @object .size cli_default_conn_timeout, 4 cli_default_conn_timeout: .zero 4 .text .Letext0: ... which is reflected in the .o file as (gcc-9): ... 0000000000000004 C cli_ten_minutes_timeout 0000000000000004 C cli_default_conn_timeout ... and (gcc-10): ... 0000000000000020 B cli_ten_minutes_timeout 0000000000000024 B cli_default_conn_timeout ... See nm(1) and ld(1) for a description C (common) and B (BSS) and how they are treated by the linker. Note: there is still a small chance that gcc-10 will land in Fedora-32, despite 31 Dec. 2019 having been the deadline for that to happen. Change-Id: I54ea485736a4910254eeb21222ad263721cdef3c Fixes: bz#1193929 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
* lock: fix Coverity CID 1412107Xie Changlong2020-01-061-0/+2
| | | | | | | | To avoid memory leak. Change-Id: Ib802be310fe989223afd623d3e5a9c9016d4fd38 updates: bz#789278 Signed-off-by: Xie Changlong <xiechanglong@cmss.chinamobile.com>
* [geo-rep] Improving help message in schedule_georep.py.inkshithijiyer2020-01-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | SLAVE positional argument doesn't provide a clear picture of what it is when compared to mastervol and slavevol in schedule_georep.py.in. It would be better if we change it to something like "Slave hostame (<username>@SLAVEHOST or SLAVEHOST)" Present: ---------- positional arguments: mastervol Master Volume Name SLAVE SLAVEHOST or root@SLAVEHOST or user@SLAVEHOST slavevol Slave Volume Name Suggested: ----------- positional arguments: mastervol Master Volume Name SLAVE Slave hostname (<username>@SLAVEHOST or SLAVEHOST) slavevol Slave Volume Name fixes: bz#1786276 Change-Id: I73d52247997d623f77d55e51cbb6eccc08eb95ff Signed-off-by: kshithijiyer <kshithij.ki@gmail.com>
* geo-rep: Note section is required for ignore_deletesShwetha K Acharya2020-01-036-11/+102
| | | | | | | | | | | | | | | | There exists a window of 15 sec, where the deletes are picked up by history crawl when the ignore_deletes is set to true. And it eventually deletes the file/s from slave which is/are not supposed to be deleted. Though it is working as per design, a note regarding this is needed. Added a warning message indicating the same. Also logged info when the worker restarts after ignore-deletes option set. fixes: bz#1708603 Change-Id: I103be882fac18b4cef935efa355f5037a396f7c1 Signed-off-by: Shwetha K Acharya <sacharya@redhat.com>
* posix: improve posix_{set_gfid2path_xattr|remove_gfid2path_xattr} funcsYaniv Kaul2020-01-033-81/+64
| | | | | | | | | | 1. Move them to posix-entry-ops.c and make them static. 2. Remove useless 'val' parameter allocation and snprintf() in posix_set_gfid2path_xattr(), as it was identical to pgfid_bname. Change-Id: I41f3946c6c42aee9d7cf1150e21b442438fbcce2 updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
* afr: simplify afr_has_quorum()Yaniv Kaul2020-01-023-29/+10
| | | | | | | | | | | | | 1. Perform AFR_COUNT() once, in afr_has_quorum() and pass the result to afr_lookup_has_quorum() 2. Simplify afr_lookup_has_quorum() - pass less parameters to it. (Via the change in item 1 above). 3. Make afr_is_add_replica_mount_lookup_on_root() static function. 4. Remove dead code - afr_decide_heal_info() which was not used. Change-Id: If9168cd01e22788a0e60b91e315787d2aa60e97b updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
* Remove some compiler warnings when not compiling gNFSYaniv Kaul2020-01-022-4/+4
| | | | | | | | | | As a follow up to https://review.gluster.org/#/c/glusterfs/+/23799/ When compiling without gNFS, there were some 'unused' warnings by the compiler. This patch fixes them. Change-Id: I621562261f53950e821a450e0e7da304d00ae557 updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
* glusterd: deafult options after volume resetSanju Rakonde2020-01-012-0/+28
| | | | | | | | | | | | | | | | | | | Problem: default option itransport.address-family is disappered in volume info output after a volume reset. Cause: with 3.8.0 onwards volume option transport.address-family has default value, any volume which is created will have this option set. So, volume info will show this in its output. But, with reset volume, this option is not handled. Solution: In glusterd_enable_default_options(), we should add this option along with other default options. This function is called by glusterd_options_reset() with volume reset command. fixes: bz#1786478 Change-Id: I58f7aa24cf01f308c4efe6cae748cc3bc8b99b1d Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* cli, libglusterfs: rely on libpthread static initializersDmitry Antipov2020-01-014-45/+11
| | | | | | | | | | | | cli-cmd.c: drop cli_cmd_cond_init() because static mutex and condition variable are initialized with PTHREAD_xxx_INITIALIZERs. syncop-utils.c: since assignment PTHREAD_xxx_INITIALIZERs are never failed, a few overengineered bits may be simplified. Change-Id: Ic4d250a1697047386989f73f058b0abc8b55627b Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru> Updates: bz#1193929
* posix-inode-fd-ops.c: fix a compiler warning - real_path may be NULLYaniv Kaul2020-01-011-1/+1
| | | | | | | | | | | | | | | | | | | | Fixes the following: posix-inode-fd-ops.c: In function ‘posix_common_removexattr’: ../../../../libglusterfs/src/glusterfs/logging.h:231:9: warning: ‘%s’ directive argument is null [-Wformat-overflow=] 231 | _gf_msg(dom, __FILE__, __FUNCTION__, __LINE__, level, errnum, 0, \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 232 | msgid, ##fmt); \ | ~~~~~~~~~~~~~ posix-inode-fd-ops.c:4401:13: note: in expansion of macro ‘gf_msg’ 4401 | gf_msg(this->name, GF_LOG_WARNING, errno, P_MSG_FDSTAT_FAILED, | ^~~~~~ posix-inode-fd-ops.c:4402:47: note: format string is defined here 4402 | "fdstat operaton failed on %s", real_path); | ^~ Change-Id: I3f2278d3a05a569dde257d66f44a8655491b4013 updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
* features/changelog: Optimization in changelogShwetha K Acharya2020-01-012-3/+31
| | | | | | | | | | | | Problem: Currently changelog is written in one directory, which over time, results in very large changelog files. Solution: Seperate directory under the changelogs directory is created on daily basis following the format year/month/day. Updates: #154 Change-Id: I1cdabe33728a0ba1f298c8908bd8c323b1871bda Signed-off-by: Shwetha K Acharya <sacharya@redhat.com>
* posix: Avoid diskpace error in case of overwriting the dataMohit Agrawal2020-01-013-17/+126
| | | | | | | | | | | | | | Problem: Sometime fops like posix_writev, posix_fallocate, posix_zerofile failed and throw error ENOSPC if storage.reserve threshold limit has reached even fops is overwriting the data Solution: Retry the fops in case of overwrite if diskspace check is failed Credits: kinsu <vpolakis@gmail.com> Change-Id: I987d73bcf47ed1bb27878df40c39751296e95fe8 Updates: #745 Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
* posix-entry-ops.c: remove some tier related codeYaniv Kaul2020-01-013-27/+0
| | | | | | | | | | | Remove TIER_LINKFILE_GFID related code from posix Tier xlator was removed, but there are some code related to it scattered around in DHT and Posix xlators. Remove some of it. Change-Id: I3a878b31ed4a045ed419f936aa1d567ded1a273f updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
* mgmt/brick-mux: Avoid sending two response when attach is failed.Mohammed Rafi KC2019-12-311-1/+9
| | | | | | | | | | | We were sending two response back to glusterd when an attach is failed. One from the handler function glusterfs_handle_attach and another from rpcsvc_check_and_reply_error. It was causing problems like ref leaks, transport disconnect etc. Change-Id: I3bb5b59959530760b568d52becb519499b3dcd2b updates: bz#1785143 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
* transport/socket: destroy notify mutex and condition variableDmitry Antipov2019-12-311-0/+5
| | | | | | Change-Id: Id74f829dc5c6a30d19e3c3ef42bcb938afc0d8e4 Updates: bz#1430623 Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
* socket: fix typos and drop unused members/optionsDmitry Antipov2019-12-273-14/+7
| | | | | | | | | | Consistently fix 'configued' -> 'configured' typo, remove useless members from 'socket_private_t' and unused 'transport.socket.lowlat' option. Adjust tests as well. Change-Id: I285be196457763aec16b184acd26b90623074dec Updates: bz#1193929 Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
* extras: enable log rotation for USS logsSunny Kumar2019-12-271-0/+21
| | | | | | | | Added logrotate support for user serviceable snapshot's logs. Change-Id: Ic920eaa8ab5e44daf5937a027c6913d7bb26d517 Fixes: bz#1786722 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
* Avoid buffer overwrite due to uuid_utoa() misuseDmitry Antipov2019-12-275-25/+40
| | | | | | | | | | | | | | | Code like: f(..., uuid_utoa(x), uuid_utoa(y)); is not valid (causes undefined behaviour) because uuid_utoa() uses the only static thread-local buffer which will be overwritten by the subsequent call. All such cases should be converted to use uuid_utoa_r() with explicitly specified buffer. Change-Id: I5e72bab806d96a9dd1707c28ed69ca033b9c8d6c Updates: bz#1193929 Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
* xlator/bit-rot-stub: structure loggingyatipadia2019-12-272-148/+141
| | | | | | | | convert gf_msg() to gf_smsg() Change-Id: I3072ba4305b720bea053688d140660d7d5c2d267 Updates: #657 Signed-off-by: yatipadia <ypadia@redhat.com>
* timer: fix event destruction raceXavi Hernandez2019-12-271-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In current timer implementation, each event has an absolute time at which it will be fired. When the first timer of the queue has not elapsed yet, a pthread_cond_timedwait() is used to wait until the expected time. Apparently that's fine. However the time passed to that function was a pointer to the timespec structure contained in the event itself. This is problematic because of how pthread_cond_timedwait() works internally. Simplifying a bit, pthread_cond_timedwait() basically queues itself as a waiter for the given condition variable and releases the mutex. Then it does the timed wait using the passed value. With that in mind, the follwing case is possible: Timer Thread Other Thread ------------ ------------ gf_timer_call_cancel() pthread_mutex_lock() | + pthread_mutex_lock() event = current_event() | pthread_cond_timedwait(&event->at) | + pthread_mutex_unlock() | | + remove_event() | + destroy_event() + timed_wait(&event->at) As we can see, the time is used after it has been destroyed, which means we have a use-after-free problem. This patch fixes the problem by copying the time to a local variable before calling pthread_cond_timedwait() Change-Id: I0f4e8eded24fe3a1276dc75c6cf093bae973d26b Signed-off-by: Xavi Hernandez <xhernandez@redhat.com> Fixes: bz#1785208
* Revert "store.c: remove a sys_stat() call - just open the file"Sanju Rakonde2019-12-251-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit da735ad9b58b76d27c580a9feb63f14b2cc0669d. This commit is changing the behaviour of glusterd during its initialization. The removed piece of code checks whether the file mentioned in the path exists or not, if not it returns -1. This return value is considered for the sub sequent operations. By removing this code, we always return 0 and some part of the code will not be executed in the following code path. glusterd_options_init() -> glusterd_store_retrieve_options() -> gf_store_handle_retrieve() In glusterd_options_init(), we are not executing any code if the ret value is 0. ret = glusterd_store_retrieve_options(this); if (ret == 0) { goto out; } as we are not executing any code if the return value is 0, we are unable to enable the brick-multiplex feature using volume set. fixes: bz#1786459 Change-Id: I4f52b7b2ea8adb8df5087bb96927e9bb7db5b491
* libglusterfs/logger - code cleaningBarak Sason2019-12-201-56/+35
| | | | | | | | | | | Fixes: bz#1765186 1 - Removed code duplication of 'log_levles' array 2 - Declared all static methods at the begining of the .c file 3 - Removed unused structs that existed in the .c file Change-Id: I37330cb133fc65deac69b7ca60779f70501c24ea Signed-off-by: Barak Sason <bsasonro@redhat.com>
* md-cache.c: move cache-swift-metadata to off by defaultYaniv Kaul2019-12-201-1/+1
| | | | | | | | | | | | This causes mdc_xattr_list_populate() NOT to add "user.swift.metadata" as an xattr in the list of attrs we look at in some paths of the code. This is documented @ https://github.com/gluster/glusterfs/issues/775 Change-Id: Ie3d676c74a2f333beeacc302e253efe9f9942d1a updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
* store.c: remove a sys_stat() call - just open the fileYaniv Kaul2019-12-201-10/+1
| | | | | | | | | I don't see the value on performing a sys_stat() on a path instead of just trying to open the file. Change-Id: Ib3f88d8c45aea091eafea17c4be02e2acdb713f1 updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
* afr_inode/xlator: structure loggingyatipadia2019-12-203-57/+159
| | | | | | | | convert gf_msg() into gf_smsg() Change-Id: I8f5b7bbb9caa78902b06f67257502b67adab7405 Updates: #657 Signed-off-by: yatipadia <ypadia@redhat.com>
* tests/fuse/bug-965974.t: turn off md-cache, to fix failure of the testRaghavendra G2019-12-191-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Imagine the following set of operations: 1. touch $M0/file 2. ln $M0/file $M0/file.lnk 3. rm $M1/file 4. wait for md-cache-timeout 5. stat $M0/file.lnk $M0/file stat on $M0/file in step 5 succeeds when md-cache-timeout is non-zero even though it was removed from $M1. The reason is 1. fuse-bridge on $M0 would resolve both file and file.lnk to same inode. This inode i1 is cached in md-cache. 2. After md-cache-timeout lookup on $M0/file.lnk would be sent to backend. This lookup will be successful as file.lnk is present on backend and would refresh the md-cache. 3. The lookup on $M0/file sent within md-cache-timeout after lookup on $M0/file.lnk would be sent with i1. Since i1 was refreshed by lookup on $M0/file.lnk, the cache is deemed valid and md-cache responds lookup on $M0/file as success To fix this failure we can either: 1. remove lookup on $M0/file.lnk, so that lookup on $M0/file is actually sent to backend. 2. turn off md-cache This patch chooses option 2. credits: Csaba Henk <csaba@redhat.com> Change-Id: I352c2acd377fe10c4bdf3b6e53c1de86a4e544c7 Signed-off-by: Raghavendra G <rgowdapp@redhat.com> Updates: bz#1756900
* glfsheal: install as architecture-dependent binary helperDmitry Antipov2019-12-194-6/+7
| | | | | | | | | | | | Since glfsheal is a binary helper which is not intented to be invoked directly, install it under %{libexecdir}/glusterfs rather than %{sbindir}, adjust invocation from CLI code and RPM spec. Credits: Ravishankar N <ravishankar@redhat.com>. Fixes: bz#1780190 Change-Id: I4b41892d96b89c24a332470ac8c1e82f6795159a Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
* cli-rpc-ops.c: cleanupsYaniv Kaul2019-12-192-1399/+967
| | | | | | | | | | | | | | | | | | | | | | | | | | 1. Move functions and structs to static 2. Use dictionary functions with fixed key length. 3. Reduce key length when not needed. 4. Use const char* for some messages. 5. Use fixed strings for some logs which is repeated in the code. 6. Remove redundant checks. Specifically, cli_to_glusterd() does NULL checks already, so no need to do it before calling it. 7. Aligned some messages - not sure why they were cut over several lines, but it made grep on the code harder. 8. Move dictionary fetching of values closer to where they are actually used. Overall, object size is ~4 smaller, hopefully without functional changes. There's more that can be done, but as this is a very long (>10K lines) file, I think it's enough for one change. Specifically, some functions fetch values from the dictionary without using it - this is a bit of a waste. Filed https://github.com/gluster/glusterfs/issues/753 about it. Change-Id: I31f88d94ab25398e00aef2ea84a8c4af9383b75b updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
* glusterd: refactoring long methodBarak Sason Rofman2019-12-195-330/+95
| | | | | | | | | | | - Refactored set_fuse_mount_options(...) in order to shorten it. - Removed dead code and moved some method to it's apropriate location. - Converted loggin in set_fuse_mount_options(...) to structured logs fixes: bz#1768896 Change-Id: If865833d4c60d517da202871978691ef21235fe4 Signed-off-by: Barak Sason Rofman <bsasonro@redhat.com>
* test: fix non-root test case for geo-repSunny Kumar2019-12-181-1/+1
| | | | | | | | | | | | | | | Problem: On a freshly installed system non-root geo-rep test case gets blocked. Solution: On a freshly installed system, the remote key need to be accepted automatically by ssh-copy-id. Credits: M. Scherer <mscherer@redhat.com> Change-Id: I5077f99a6681660f7e3e84c25ef216f521b7c29c Fixes: bz#1779742 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
* [RFC]#ifdef gNFS related code if we are not compiling gNFSYaniv Kaul2019-12-1817-30/+67
| | | | | | | | | | | | | | | | If we are not compiling gNFS (--enable-gnfs is not given in the ./configure script params), there is little point in compiling code that is related to it. This patch tries to eliminate it. My hope (and it's not clear from the code ) is that I did not break the NFS Ganesha support as well. Other than that, tried to compile with and without anad it looks sane. Change-Id: I8d6c98066b9fceab4ec10fc6f5e81ab069e853bd updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
* glusterd: unlink the file after killing the processSanju Rakonde2019-12-181-0/+2
| | | | | | | | | | In glusterd_proc_stop(), after killing the pid we should remove the pidfile. fixes: bz#1784375 Change-Id: Ib6367aed590932c884b0f6f892fc40542aa19686 Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* call-stub.c: remove redundant validationYaniv Kaul2019-12-181-163/+0
| | | | | | | | | | | | GF_VALIDATE_OR_GOTO("call-stub", frame, out) is removed. It's not needed, since we are testing via the creation of a stub, in stub_new() that frame is not NULL. Removed all redundant checks, which saves >10% in object size. Change-Id: If4ce3a3dc506a5e65e98b59fa51b1fdd389a85ba updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
* [Cli] Removing old log rotate command.kshithijiyer2019-12-174-10/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | The old command for log rotate is still present removing it completely. Also adding testcase to test the log rotate command with both the old as well as the new command and fixing testcase which use the old syntax to use the new one. Code to be removed: 1. In cli-cmd-volume.c from struct cli_cmd volume_cmds[]: {"volume log rotate <VOLNAME> [BRICK]", cli_cmd_log_rotate_cbk, "rotate the log file for corresponding volume/brick" " NOTE: This is an old syntax, will be deprecated from next release."}, 2. In cli-cmd-volume.c from cli_cmd_log_rotate_cbk(): ||(strcmp("rotate", words[2]) == 0))) 3. In cli-cmd-parser.c from cli_cmd_log_rotate_parse() if (strcmp("rotate", words[2]) == 0) volname = (char *)words[3]; else fixes: bz#1750387 Change-Id: I56e4d295044e8d5fd1fc0d848bc87e135e9e32b4 Signed-off-by: kshithijiyer <kshithij.ki@gmail.com>
* DHT - Reduce methods scope (dht-common.c)Barak Sason Rofman2019-12-173-804/+708
| | | | | | | | | | | Methods that should have been static were defined as global, and the other way around. This patch fixes the issue in order to enforce encapsulation. updates: bz#1776757 Change-Id: I3eb5781849c5e597c1dd347e03f356c00db62a39 Signed-off-by: Barak Sason Rofman <bsasonro@redhat.com>
* dht-common.h/dht-helper.c: exctract the LOCK() from DHT_UPDATE_TIMEYaniv Kaul2019-12-172-20/+20
| | | | | | | | | | | | | Currently, the code (and only place) that is using this macro is in dht_inode_ctx_time_update() where it is called 3 times in a row, which is essentially 3 cycles of LOCK/UNLOCK on the same lock. Instead, extract the LOCK()/UNLOCK() part of the macro and wrap those calls with it. Change-Id: I6312b985e3d97517857b55f342440accc4063db6 updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
* rpc: define xdr_sizeof regardless of whether IPv6 is the defaultAndrew Miloradovsky2019-12-131-2/+0
| | | | | Change-Id: I4f20f376d82b28e1c572c0fd0b6cd38e97b133da Fixes: bz#1780260