summaryrefslogtreecommitdiffstats
path: root/cli
Commit message (Collapse)AuthorAgeFilesLines
* event: rename event_XXX with gf_ prefixedXiubo Li2019-07-292-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I hit one crash issue when using the libgfapi. In the libgfapi it will call glfs_poller() --> event_dispatch() in file api/src/glfs.c:721, and the event_dispatch() is defined by libgluster locally, the problem is the name of event_dispatch() is the extremly the same with the one from libevent package form the OS. For example, if a executable program Foo, which will also use and link the libevent and the libgfapi at the same time, I can hit the crash, like: kernel: glfs_glfspoll[68486]: segfault at 1c0 ip 00007fef006fd2b8 sp 00007feeeaffce30 error 4 in libevent-2.0.so.5.1.9[7fef006ed000+46000] The link for Foo is: lib_foo_LADD = -levent $(GFAPI_LIBS) It will crash. This is because the glfs_poller() is calling the event_dispatch() from the libevent, not the libglsuter. The gfapi link info : GFAPI_LIBS = -lacl -lgfapi -lglusterfs -lgfrpc -lgfxdr -luuid If I link Foo like: lib_foo_LADD = $(GFAPI_LIBS) -levent It will works well without any problem. And if Foo call one private lib, such as handler_glfs.so, and the handler_glfs.so will link the GFAPI_LIBS directly, while the Foo won't and it will dlopen(handler_glfs.so), then the crash will be hit everytime. The link info will be: foo_LADD = -levent libhandler_glfs_LIBADD = $(GFAPI_LIBS) I can avoid the crash temporarily by linking the GFAPI_LIBS in Foo too like: foo_LADD = $(GFAPI_LIBS) -levent libhandler_glfs_LIBADD = $(GFAPI_LIBS) But this is ugly since the Foo won't use any APIs from the GFAPI_LIBS. And in some cases when the --as-needed link option is added(on many dists it is added as default), then the crash is back again, the above workaround won't work. Fixes: #699 Change-Id: I38f0200b941bd1cff4bf3066fca2fc1f9a5263aa Signed-off-by: Xiubo Li <xiubli@redhat.com>
* cli: defer create_frame() (and dict creation) to later stages.Yaniv Kaul2019-07-165-151/+199
| | | | | | | | | Where possible, defer create_frame() - whenever possible, after command line verification, for example. Change-Id: Id6606e90e7ea6190f30b225c4733b229c519bb2f updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
* cli: Remove Wformat-truncation compiler warningSheetal Pamecha2019-07-022-19/+59
| | | | | | | | | | | | This warning is issued due to unhandled output truncation. As in the code, truncation is expected, we can remove this warning by placing a check on the return value of the function and handling it. In this way, the warning will not be issued. Change-Id: I1820b58fe9a7601961c20944b259df322db35057 updates: bz#1193929 Signed-off-by: Sheetal Pamecha <spamecha@redhat.com>
* Removing one top command from gluster v helpkshithijiyer2019-07-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | The current help show 2 different top commands intead of one single top command which can be easily observed when "# gluster v help" command is issued. Removing one "volume top <VOLNAME>" and clubbing into them into a single command. Current help: volume top <VOLNAME> {open|read|write|opendir|readdir|clear} [nfs|brick <brick>] [list-cnt <value>] | volume top <VOLNAME> {read-perf|write-perf} [bs <size> count <count>] [brick <brick>] [list-cnt <value>] - volume top operations Expected help: volume top <VOLNAME> {open|read|write|opendir|readdir|clear} [nfs|brick <brick>] [list-cnt <value>] | {read-perf|write-perf} [bs <size> count <count>] [brick <brick>] [list-cnt <value>] - volume top operations fixes: bz#1725034 Change-Id: Ifbc4c95f2558286e27dfc5e9667046b80eb1715d Signed-off-by: kshithijiyer <kshithij.ki@gmail.com>
* glusterd/thin-arbiter: Thin-arbiter integration with GD1Vishal Pandey2019-06-283-6/+158
| | | | | | | | | | | | | | | | | | | | | | | | gluster volume create <VOLNAME> replica 2 thin-arbiter 1 <host1>:<brick1> <host2>:<brick2> <thin-arbiter-host>:<path-to-store-replica-id-file> [force] The changes have been made in a way that the last brick in the bricks list will be treated as the thin-arbiter. GD1 will be manipulated to consider replica count to be as 2 and continue creating the volume like any other replica 2 volume but since thin-arbiter volumes need ta-brick client xlator entries for each subvolume in fuse volfile, volfile generation is modified in a way to inject these entries seperately in the volfile for every subvolume. Few more additions - 1- Save the volinfo with new fields ta_bricks list and thin_arbiter_count. 2- Introduce a new option client.ta-brick-port to add remote-port to ta-brick xlator entry in fuse volfiles. The option can be set using the following CLI syntax - gluster volume set <VOLNAME> client.ta-brick-port <PORTNO.> 3- Volume Info will contain a Thin-Arbiter-path entry to distinguish from other replicate volumes. Change-Id: Ib434e2313b29716f32476c6c211d282c4ef39406 Updates #687 Signed-off-by: Vishal Pandey <vpandey@redhat.com>
* Adding white spaces to description of set group.kshithijiyer2019-06-251-4/+4
| | | | | | | | | | | | | | | | | | | | The description of set group is missing spaces which leads to the description look like: volume set <VOLNAME> group <GROUP> - This option can be used for setting multiple pre-defined volume optionswhere group_name is a file under /var/lib/glusterd/groups containing onekey, value pair per line Instead of: volume set <VOLNAME> group <GROUP> - This option can be used for setting multiple pre-defined volume options where group_name is a file under /var/lib/glusterd/groups containing one key value pair per line Fixes: bz#1723455 Change-Id: I4957988c0c1f35f043db3f64089c049193e60e8f Signed-off-by: kshithijiyer <kshithij.ki@gmail.com>
* cli: don't fail if logging initialize failsAmar Tumballi2019-06-171-1/+0
| | | | | | | | | | | | in many cases, gluster's cli can run as non-privileged mode (like in geo-rep non-root setup). Just because logging fails in cli, lets not fail the overall process. Not much of debugging help in CLI logs anyways. Most of the debugging happens once the call reaches server (glusterd). Fixes: bz#1535511 Change-Id: I9f07c61b8c3acc95ec08230ff539a35dfd0ff9dc Signed-off-by: Amar Tumballi <amarts@redhat.com>
* build: always build glusterfs-cli to allow monitoring/managing from clientsNiels de Vos2019-06-151-2/+0
| | | | | | Fixes: bz#1720615 Change-Id: I5071f3255ff615113b36b08cd5326be6e37d907d Signed-off-by: Niels de Vos <ndevos@redhat.com>
* cli: Remove-brick warning seems unnecessaryShwetha K Acharya2019-06-121-8/+9
| | | | | | | | | | | As force-migration option is disabled by default, the warning seems unnessary. Rephrased the warning to make best sense out of it. fixes: bz#1712668 Change-Id: Ia18c3c5e7b3fec808fce2194ca0504a837708822 Signed-off-by: Shwetha K Acharya <sacharya@redhat.com>
* Fix some "Null pointer dereference" coverity issuesXavi Hernandez2019-05-262-2/+2
| | | | | | | | | | | | | | | | | | | | | | This patch fixes the following CID's: * 1124829 * 1274075 * 1274083 * 1274128 * 1274135 * 1274141 * 1274143 * 1274197 * 1274205 * 1274210 * 1274211 * 1288801 * 1398629 Change-Id: Ia7c86cfab3245b20777ffa296e1a59748040f558 Updates: bz#789278 Signed-off-by: Xavi Hernandez <xhernandez@redhat.com>
* geo-rep: Geo-rep help text issueShwetha K Acharya2019-05-231-2/+2
| | | | | | | | | Modified Geo-rep help text for better sanity. fixes: bz#1652887 Change-Id: I40ef7ef709eaecf0125ab4b4a7517e2c5d1ef4a0 Signed-off-by: Shwetha K Acharya <sacharya@redhat.com>
* cli: Fixed typosN Balachandran2019-05-231-2/+2
| | | | | | Change-Id: I14957c5161f31d5dfc6cf56f8d7ccf4d39372f39 fixes: bz#1711820 Signed-off-by: N Balachandran <nbalacha@redhat.com>
* cli: Validate invalid slave urlKotresh HR2019-05-113-5/+27
| | | | | | | | | This patch validates the invalid slave url in cli itself and throws appropriate error. fixes: bz#1098991 Change-Id: I278e2a04a4d619d2c2d1db0dd56ab5bdf7e7f469 Signed-off-by: Kotresh HR <khiremat@redhat.com>
* tier/cli: remove tier code to increase code coverage in cliSanju Rakonde2019-04-257-1904/+64
| | | | | | Change-Id: I56cc09243dab23b3be86a7faac45001dda77181f updates: bz#1693692 Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* core: avoid dynamic TLS allocation when possibleXavi Hernandez2019-04-241-2/+1
| | | | | | | | | | | | | | | | | | | Some interdependencies between logging and memory management functions make it impossible to use the logging framework before initializing memory subsystem because they both depend on Thread Local Storage allocated through pthread_key_create() during initialization. This causes a crash when we try to log something very early in the initialization phase. To prevent this, several dynamically allocated TLS structures have been replaced by static TLS reserved at compile time using '__thread' keyword. This also reduces the number of error sources, making initialization simpler. Updates: bz#1193929 Change-Id: I8ea2e072411e30790d50084b6b7e909c7bb01d50 Signed-off-by: Xavi Hernandez <xhernandez@redhat.com>
* glusterd: display an error when rebalance start is failedSanju Rakonde2019-04-121-1/+0
| | | | | | | | fixes: bz#1699176 credits: Hari Gowtham <hgowtham@redhat.com> Change-Id: I59134336febf0dc4043483f2f413ac83e3bc79f5 Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* Multiple files: remove HAVE_BD_XLATOR related code.Yaniv Kaul2019-03-253-83/+0
| | | | | | | | | | | | The BD translator was removed some time ago, (in commit a907e468e724c32b9833ce59806fc215c7122d63). This completes the work. Compile-tested only! updates: bz#1635688 Signed-off-by: Yaniv Kaul <ykaul@redhat.com> Change-Id: I999df52e479a72d3cc9523f22f9056de17eb559c
* inode: fix unused varsAtin Mukherjee2019-03-221-1/+2
| | | | | | | | | Commit 6d6a3b2 introduced some unused vars. This patch defines them within #ifdef DEBUG Fixes: bz#1580315 Change-Id: I8a332b00c3ffb66689b4b6480c490b9436c17d63 Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
* rpc/transport: Missing a ref on dict while creating transport objectMohammed Rafi KC2019-03-201-9/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | while creating rpc_tranpsort object, we store a dictionary without taking a ref on dict but it does an unref during the cleaning of the transport object. So the rpc layer expect the caller to take a ref on the dictionary before passing dict to rpc layer. This leads to a lot of confusion across the code base and leads to ref leaks. Semantically, this is not correct. It is the rpc layer responsibility to take a ref when storing it, and free during the cleanup. I'm listing down the total issues or leaks across the code base because of this confusion. These issues are currently present in the upstream master. 1) changelog_rpc_client_init 2) quota_enforcer_init 3) rpcsvc_create_listeners : when there are two transport, like tcp,rdma. 4) quotad_aggregator_init 5) glusterd: init 6) nfs3_init_state 7) server: init 8) client:init This patch does the cleanup according to the semantics. Change-Id: I46373af9630373eb375ee6de0e6f2bbe2a677425 updates: bz#1659708 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
* inode: don't dump the whole table to CLIAmar Tumballi2019-03-201-0/+22
| | | | | | | | | | | dumping the whole inode table detail to screen doesn't solve any purpose. We should be getting only toplevel details on CLI, and then if one wants to debug further, then they need to get to 'statedump' to get full details. Fixes: bz#1580315 Change-Id: Iaf3de94602f9c76832c3c918ffe2ad13c0b0e448 Signed-off-by: Amar Tumballi <amarts@redhat.com>
* geo-rep: IPv6 supportAravinda VK2019-03-152-0/+12
| | | | | | | | | | | | | `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>`. Fixes: bz#1688833 Change-Id: I1e0d42cae07158df043e64a2f991882d8c897837 Signed-off-by: Aravinda VK <avishwan@redhat.com>
* cli : fix mem leak during cli_cmd_volume_gsync_set_cbkSunny Kumar2019-02-191-20/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes mem-leak due to excessive use of gf_asprintf to form dynamic growing string. Problem: each call to asprintf/vsprintf for extending existing string causes a memory leak, because the blob at the original address of existing string is not freed and a new location is generated by asprintf. Tracebacks: #2 0x7fdf191b8b3b in gf_vasprintf ../libglusterfs/src/mem-pool.c:236 #3 0x7fdf191b8d0a in gf_asprintf ../libglusterfs/src/mem-pool.c:256 #4 0x420cd3 in cli_cmd_volume_gsync_set_cbk ../cli/src/cli-cmd-volume.c:2576 SUMMARY: AddressSanitizer: 255 byte(s) leaked in 3 allocation(s). .... SUMMARY: AddressSanitizer: 431 byte(s) leaked in 4 allocation(s). .... SUMMARY: AddressSanitizer: 449 byte(s) leaked in 4 allocation(s). .... SUMMARY: AddressSanitizer: 397 byte(s) leaked in 4 allocation(s). .... SUMMARY: AddressSanitizer: 160 byte(s) leaked in 2 allocation(s). .... updates: bz#1633930 Change-Id: I7e8902f0ed23e640dc17e3dcbdab7ae0579d2dc6 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
* socket: socket event handlers now return voidMilind Changire2019-02-181-2/+2
| | | | | | | | | | | | | | 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' Change-Id: I70dc2c57f12b7ea2fae41120f71aa0d7fe0b2b6f Fixes: bz#1651246 Signed-off-by: Milind Changire <mchangir@redhat.com>
* cli: Added the group option for volume setRinku Kothiya2019-02-041-0/+5
| | | | | | | | | | | 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>
* cli: Added a welcome and help messageRinku Kothiya2019-01-212-0/+6
| | | | | | | | | | 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>
* core: Feature added to accept CidrIp in auth.allowRinku Kothiya2019-01-182-4/+4
| | | | | | | | | | | | | | | 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>
* libglusterfs/src/mem-types.h: remove unused common enums from mem-types.hYaniv Kaul2018-12-301-8/+1
| | | | | | | | | | | | | | | | | 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
* cli: fix memory leakSunny Kumar2018-12-261-23/+72
| | | | | | | | This patch fixes memory leak in cli/src/cli.c. Change-Id: I4956c4180b34d4a9e3e6e60eeafba8cb2031896e updates: bz#1633930 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
* cli: variable-length array declaration clang fixSheetal Pamecha2018-12-141-2/+5
| | | | | | | | | | | 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>
* cli : fix memory leak in cli-cmd-volume.cSunny Kumar2018-12-101-6/+6
| | | | | | | | | | | | | | | | | | | This patch fixes ememory leak reported by ASan. Tracebacks: Direct leak of 84 byte(s) in 1 object(s) allocated from: #0 0x7f71ea107848 in __interceptor_malloc (/lib64/libasan.so.5+0xef848) #1 0x7f71e9e2ac49 in __gf_malloc ./libglusterfs/src/mem-pool.c:136 #2 0x7f71e9e2b4bb in gf_vasprintf ./libglusterfs/src/mem-pool.c:236 #3 0x7f71e9e2b68a in gf_asprintf ./libglusterfs/src/mem-pool.c:256 #4 0x41e8ec in cli_cmd_bitrot_cbk ./cli/src/cli-cmd-volume.c:1847 #5 0x410b39 in cli_cmd_process ./cli/src/cli-cmd.c:137 #6 0x40fe9d in cli_batch ./cli/src/input.c:29 #7 0x7f71e989558d in start_thread (/lib64/libpthread.so.0+0x858d) updates: bz#1633930 Change-Id: I8977e45add742e67047291f398f0ee79eb09afe4 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
* cli: fix memory leak in cli rpc opsMohit Agrawal2018-12-071-0/+4
| | | | | | | | | | | | | 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>
* cli: fix a memory leak reported by ASan.Rinku Kothiya2018-12-061-0/+2
| | | | | | | | | | | Fixed a leak in cli_cmd_volume_remove_brick_cbk. SUMMARY: AddressSanitizer: 1152 byte(s) leaked in 8 allocation(s) updates: bz#1633930 Credits: Mohit Agrawal Change-Id: Idb59c3880329fde59c415c84d7f0bb09ae879a1a Signed-off-by: Rinku Kothiya <rkothiya@redhat.com>
* cli: Fix mem-leaks reported by ASANKotresh HR2018-12-061-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* cli: memory leak issue reported by asanRinku Kothiya2018-12-051-0/+2
| | | | | | | | | | This patch fixes dict leak in cli_cmd_volume_stop_cbk. SUMMARY: AddressSanitizer: 640 byte(s) leaked in 4 allocation(s) Credits: Mohit Agrawal Change-Id: If14983b8588e68d16d6bbb04b87e2f06fb97023d fixes: bz#1633930 Signed-off-by: Rinku Kothiya <rkothiya@redhat.com>
* libglusterfs: Move devel headers under glusterfs directoryShyamsundarR2018-12-0512-43/+43
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* cli: fix memory leak in cli/src/cli-rpc-ops.cSunny Kumar2018-12-051-0/+3
| | | | | | | | | | | | 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>
* cli: memory leak issue reported by asanHarpreet kaur2018-12-051-0/+4
| | | | | | | | | | | | 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>
* cli: fix memory leak in cli-cmd-system.cSunny Kumar2018-12-051-4/+11
| | | | | | | | | | This patch fixes memory leak reported by ASan. SUMMARY: AddressSanitizer: 384 byte(s) leaked in 2 allocation(s). updates: bz#1633930 Change-Id: I93ebddcfeea3d51547e00775db2c9d99f5dfafea Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
* cli: "usage()" and "--help" for gluster cliHarpreet Kaur Lalwani2018-12-043-3/+33
| | | | | | | | | | | 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>
* cli : Memeory leak fix reported by ASANSunny Kumar2018-12-031-0/+22
| | | | | | | | | | | | | This patch fixes memory leak in cli-rpc-ops.c. Functions: gf_cli_create_volume_cbk, gf_cli_delete_volume_cbk, gf_cli_start_volume_cbk, gf_cli_remove_tier_brick_cbk, gf_cli_list_volume_cbk. updates: bz#1633930 Change-Id: I68a650fb972db18c90e6581a960eae3018f32d40 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
* cli: memory leak issue reported by asanHarpreet Lalwani2018-12-031-0/+3
| | | | | | | | | | | This patch fixes Indirect leaks in tests/bugs/heal-symlinks.t. Leaks are happening in cli_cmd_volume_heal_cbk. SUMMARY: AddressSanitizer: 640 byte(s) leaked in 4 allocation(s). Updates: bz#1633930 Change-Id: I970b4229630fdaf01aec66581c1287beef7560a3 Signed-off-by: Harpreet Lalwani <hlalwani@redhat.com>
* cli : Memeory leak fix reported by ASANSunny Kumar2018-12-021-0/+3
| | | | | | | | | | | | 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>
* rpcsvc: provide each request handler thread its own queueRaghavendra Gowdappa2018-11-291-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* geo-rep: Geo-rep help text issueShwetha K Acharya2018-11-271-4/+6
| | | | | | | | Modified Geo-rep help text for better sanity. Change-Id: I48f4d0fd60c1ffcde753b37416e0c73afd0b5702 fixes: bz#1652887 Signed-off-by: Shwetha K Acharya <sacharya@redhat.com>
* glfsheal: add a '--nolog' flagRavishankar N2018-11-263-3/+11
| | | | | | | | | | | | | | | | | | | | | ....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>
* geo-rep: validate the config checkpoint date formatShwetha Acharya2018-11-221-1/+1
| | | | | | | | 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>
* cli : fix coverity issue in cli-xml-output.cSunny Kumar2018-11-181-0/+10
| | | | | | | | This patch fixes 1124659, 1241480 and 1274196. Change-Id: Ib89f53b8e34fcc47184d08ad57f2ee32fd00d78c updates: bz#789278 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
* cli: avoid unnecessary strtail for geo rep config.Ravishankar N2018-11-111-20/+20
| | | | | | | | | | 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>
* cli: add a warning/confirmation message in peer detach code pathAtin Mukherjee2018-11-091-1/+13
| | | | | | | | | | | | | | | | | 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>
* all: fix the format string exceptionsAmar Tumballi2018-11-051-1/+1
| | | | | | | | | | | | | | | | 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>