summaryrefslogtreecommitdiffstats
path: root/rpc
Commit message (Collapse)AuthorAgeFilesLines
* dict: handle STR_OLD data type in xdr conversionsAmar Tumballi2019-03-072-0/+3
| | | | | | | | | | | | | | | | | Currently a dict conversion on wire for 3.x protocol happens using `dict_unserialize()`, which sets the type of data as STR_OLD. But the new protocol doesn't send it over the wire as its not considered as a valid format in new processes. But considering we deal with old and new protocol when we do a rolling upgrade, it will allow us to get all the information properly with new protocol. Credits: Krutika Dhananjay Fixes: bz#1684385 Change-Id: I165c0021fb195b399790b9cf14a7416ae75ec84f Signed-off-by: Amar Tumballi <amarts@redhat.com>
* socket: socket event handlers now return voidMilind Changire2019-02-251-5/+5
| | | | | | | | | | | | | | | | | | Problem: Returning any value from socket event handlers to the event sub-system doesn't make sense since event sub-system cannot handle socket sub-system errors. Solution: Change return type of all socket event handlers to 'void' mainline: > Reviewed-on: https://review.gluster.org/c/glusterfs/+/22221 Change-Id: I70dc2c57f12b7ea2fae41120f71aa0d7fe0b2b6f Fixes: bz#1651246 Signed-off-by: Milind Changire <mchangir@redhat.com> (cherry picked from commit 776ba851c6ee6c265253d44cf1d6e4e3d4a21772)
* socket: fix issue when socket write return with EAGAINZhang Huan2019-02-041-0/+2
| | | | | | | | | | | | | | In the case socket write return with EAGAIN, the remaining vector count is return all way back to event handler, making followup pollin event to skip handling and dispatch loop complains about failure. Even thought temporary write failure is not an error. [2018-12-29 07:31:41.772310] E [MSGID: 101191] [event-epoll.c:674:event_dispatch_epoll_worker] 0-epoll: Failed to dispatch handler Change-Id: Idf03d120b5f7619eda19720a583cbcc3e7da2504 updates: bz#1651246 Signed-off-by: Zhang Huan <zhanghuan@open-fs.com> (cherry picked from commit 0301a66bda44582e3a48519f2a5d365b0c38090d)
* socket: don't pass return value from protocol handler to event handlerZhang Huan2019-02-041-2/+2
| | | | | | | | | | | | Event handler handles socket level error only, while protocol handler handles in protocol level error. If protocol handler decides to disconnect on error in any case, it should call disconnect instead of return an error back to event handler. Change-Id: I9375be98cc52cb969085333f3c7229a91207d1bd updates: bz#1651246 Signed-off-by: Zhang Huan <zhanghuan@open-fs.com> (cherry picked from commit cd5714554627fe90ee2c77685cb410a8fb25eceb)
* all: fix the format string exceptionsAmar Tumballi2018-11-091-2/+2
| | | | | | | | | | | | | | | | 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#1647666 Change-Id: Ib547293f2d9eb618594cbff0df3b9c800e88bde4 Signed-off-by: Amar Tumballi <amarts@redhat.com>
* core: move logs which are only developer relevant to DEBUG levelShyamsundarR2018-09-131-1/+1
| | | | | | | | | | | | For each release, we move certain logs on master that are meant as an indicator to contributors to correct or adapt to core infrastructure changes in libglusterfs and other places. This commit achieves the above. Change-Id: I4157a7ec7d5ec9c2948b2bbc1e4cb8317f28d6b8 Updates: bz#1628620 Signed-off-by: ShyamsundarR <srangana@redhat.com>
* Land part 2 of clang-format changesGluster Ant2018-09-1220-17095/+16413
| | | | | Change-Id: Ia84cc24c8924e6d22d02ac15f611c10e26db99b4 Signed-off-by: Nigel Babu <nigelb@redhat.com>
* Land clang-format changesGluster Ant2018-09-1221-3129/+3214
| | | | Change-Id: I6f5d8140a06f3c1b2d196849299f8d483028d33b
* Modify log message 'DH ciphers are disabled' from ERROR to INFOOmar Kohl2018-09-101-1/+1
| | | | | | | | | | Per the latest comment in bz#1398237 this message is confusing for users because it suggests an error where none exists. Fixes: bz#1626319 Change-Id: I2f05999da157b11e225bf3d95edb597e964f9923 Signed-off-by: Omar Kohl <omarkohl@gmail.com>
* glusterd: Fix Buffer size issuesSanju Rakonde2018-09-041-4/+4
| | | | | | | | This patch fixes buffer size issue 1138522. Change-Id: Ia12fc8f34f75704f8ed3efae2022c4fd67a8c76c updates: bz#789278 Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* multiple files: calloc -> mallocYaniv Kaul2018-09-043-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | xlators/cluster/stripe/src/stripe-helpers.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible xlators/cluster/dht/src/tier.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible xlators/cluster/dht/src/dht-layout.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible xlators/cluster/dht/src/dht-helper.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible xlators/cluster/dht/src/dht-common.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible xlators/cluster/afr/src/afr.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible xlators/cluster/afr/src/afr-inode-read.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible tests/bugs/replicate/bug-1250170-fsync.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible tests/basic/gfapi/gfapi-async-calls-test.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible tests/basic/ec/ec-fast-fgetxattr.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible rpc/xdr/src/glusterfs3.h: Move to GF_MALLOC() instead of GF_CALLOC() when possible rpc/rpc-transport/socket/src/socket.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible rpc/rpc-lib/src/rpc-clnt.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible extras/geo-rep/gsync-sync-gfid.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible cli/src/cli-xml-output.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible cli/src/cli-rpc-ops.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible cli/src/cli-cmd-volume.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible cli/src/cli-cmd-system.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible cli/src/cli-cmd-snapshot.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible cli/src/cli-cmd-peer.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible cli/src/cli-cmd-global.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible It doesn't make sense to calloc (allocate and clear) memory when the code right away fills that memory with data. It may be optimized by the compiler, or have a microscopic performance improvement. In some cases, also changed allocation size to be sizeof some struct or type instead of a pointer - easier to read. In some cases, removed redundant strlen() calls by saving the result into a variable. 1. Only done for the straightforward cases. There's room for improvement. 2. Please review carefully, especially for string allocation, with the terminating NULL string. Only compile-tested! updates: bz#1193929 Original-Author: Yaniv Kaul <ykaul@redhat.com> Signed-off-by: Yaniv Kaul <ykaul@redhat.com> Signed-off-by: Amar Tumballi <amarts@redhat.com> Change-Id: I16274dca4078a1d06ae09a0daf027d734b631ac2
* Various files: strncpy()->sprintf(), reduce strlen()'sYaniv Kaul2018-08-311-4/+6
| | | | | | | | | | | | | | | | | | | | strncpy may not be very efficient for short strings copied into a large buffer: If the length of src is less than n, strncpy() writes additional null bytes to dest to ensure that a total of n bytes are written. Instead, use snprintf(). Check for truncated output where applicable. Also: - save the result of strlen() and re-use it when possible. - move from strlen to SLEN (sizeof() ) for const strings. Compile-tested only! Change-Id: I54e80d4f4a80e98d3775e376efe05c51af0b29eb updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
* rpc: log fuse unique ID along with gluster XIDMilind Changire2018-08-301-8/+12
| | | | | | | | | | for better traceability between fuse requests and gluster requests a mapping needs to be established in the logs between the two IDs BUG: 1623408 Change-Id: I0ef82fe69c1ad7d0ce9e3ac4f35cd82aa6e9bca9 fixes: bz#1623408 Signed-off-by: Milind Changire <mchangir@redhat.com>
* rpc/rpc-lib/src/rpc-clnt-ping.c:move to GF_MALLOC() instead of GF_CALLOC() whenYaniv Kaul2018-08-231-1/+1
| | | | | | | | | | | | | | | | It doesn't make sense to calloc (allocate and clear) memory when the code right away fills that memory with data. It may be optimized by the compiler, or have a microscopic performance improvement. Please review carefully, especially for string allocation, with the terminating NULL string. Only compile-tested! Change-Id: Ifb30412ddf1bfa509f52e0454454929b266e5658 updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
* mgmt/glusterd: Code cleanup in glusterd-volgen.cVijay Bellur2018-08-191-0/+2
| | | | | | | | | | | | | | | 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>
* All: remove memset() before sprintf()Yaniv Kaul2018-08-142-2/+0
| | | | | | | | | | | | 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>
* Fix a grammar error in the logsNigel Babu2018-08-131-1/+1
| | | | | | Change-Id: Ie4fe18d5094c051fa20de71f7fc841085cc6aaee Fixes: bz#1614142 Signed-off-by: Nigel Babu <nigelb@redhat.com>
* socket: Remove code duplicationKrutika Dhananjay2018-08-021-69/+13
| | | | | | | | | | | | | While I was reading code, I saw that socket_submit_request() and socket_submit_reply() are identical except for @a_byte and the source of @msg object being different. This patch moves all of the common code to a new function with the differing vars passed as parameters by the callers. Change-Id: I7a62ae72f10c34dc8de01b250d89a77ec5ab490d fixes: bz#1608991 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
* rpc: fix return value in rpc destroyZhang Huan2018-07-281-0/+2
| | | | | | Change-Id: I73a113e2d40f508fd53b273a990a2371692c87bf fixes: bz#1607689 Signed-off-by: Zhang Huan <zhanghuan@open-fs.com>
* rpc: add missing free of rpc->dnscacheZhang Huan2018-07-281-0/+8
| | | | | | Change-Id: I3fa97b99bf23459cf548205d75d2cc7936b2310e fixes: bz#1607689 Signed-off-by: Zhang Huan <zhanghuan@open-fs.com>
* build: rename event.h to gf-event.hNiels de Vos2018-07-274-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Newer FreeBSD versions (noticed with 10.3-RELEASE) provide a event.h file that on occasion gets included instead of the libglusterfs file. When this happens, 'struct event_pool' will not be defined and building will fail with errors like: autoscale-threads.c:18:55: error: incomplete definition of type 'struct event_pool' int thread_count = pool->eventthreadcount; ~~~~^ autoscale-threads.c:17:16: note: forward declaration of 'struct event_pool' struct event_pool *pool = ctx->event_pool; ^ This problem is caused by 'pkg-config --cflags uuid' that adds /usr/local/include to the GF_CPPFLAGS. The use of libuuid is preferred so that the contrib/uuid/ directory can be removed. By renaming event.h to gf-event.h there is no conflict between the different event.h files anymore and compiling on FreeBSD works without issues. Change-Id: Ie69f6b8a4f8f8e9630d39a86693eb74674f0f763 Updates: bz#1607319 Signed-off-by: Niels de Vos <ndevos@redhat.com>
* rpc: merge ssl infra with epoll infraMilind Changire2018-07-272-748/+814
| | | | | | | | | | | | | | | | | Patch attempts to use the epoll infra for handling SSL connections as well instead of the socket_poller() thread func. This essentially makes priv->own_thread flag redundant. SSL_connect()/SSL_accept() is now non-blocking which has done away with the localised poll() in ssl_do(). So, ssl_do() has been updated appropriately. own_thread and coincidently socket_poller() thread for SSL processing is now deprecated. Change-Id: I1ce54c06ddb643c16baa143598e7e4fbf16bae0a fixes: bz#1561332 Signed-off-by: Milind Changire <mchangir@redhat.com>
* rpc: rpc_clnt_connection_cleanup is crashed due to double freeMohit Agrawal2018-07-251-3/+17
| | | | | | | | | | | | | Problem: gfapi client is getting crashed in rpc_clnt_connection_cleanup at the time of destroying saved_frames Solution: gfapi client is getting crashed because saved_frame ptr is already freed in rpc_clnt_destroy.To avoid the same update code in rpc_clnt_destroy Change-Id: Id8cce102b49f26cfd86ef88257032ed98f43192b fixes: bz#1607783 Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
* All: run codespell on the code and fix issues.Yaniv Kaul2018-07-227-13/+14
| | | | | | | | | | | | 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>
* changelog: fix br-state-check.t crash for brick_muxMohit Agrawal2018-07-111-2/+3
| | | | | | | | | | | | Problem: br-state-check.t is getting crash Solution: Check condition in rpcsvc_request_create before allocate memory from rxpool BUG: 1597776 Change-Id: I4fde1ade6073f603c32453f1840395db9a9155b7 fixes: bz#1597776 Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
* Fix compile warningsXavi Hernandez2018-07-102-9/+18
| | | | | | | | | | | This patch fixes compile warnings that appear with newer compilers. The solution applied is only to remove the warnings, but it doesn't always solve the problem in the best way. It assumes that the problem will never happen, as the previous code assumed. Change-Id: I6e8470d6c2e2dbd3bd7d324b5fd2f92ffdc3d6ec updates: bz#1193929 Signed-off-by: Xavi Hernandez <xhernandez@redhat.com>
* rpc/clnt: Don't let consumers manage "connected" stateRaghavendra G2018-06-043-53/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The state management of "connected" in rpc is ad-hoc as far as the responsibility goes. Note that there is nothing wrong with functionality itself. rpc layer manages this state in disconnect codepath and has exposed an api to manage this one from consumers. Note that rpc layer never sets "connected" to true by itself, which forces the consumers to use this api to get a working rpc connection. The situation is best captured from a comment in code from Jeff Darcy in glusterfsd/src/gf-attach.c: -/* - * In a sane world, the generic RPC layer would be capable of tracking - * connection status by itself, with no help from us. It might invoke our - * callback if we had registered one, but only to provide information. Sadly, - * we don't live in that world. Instead, the callback *must* exist and *must* - * call rpc_clnt_{set,unset}_connected, because that's the only way those - * fields get set (with RPC both above and below us on the stack). If we don't - * do that, then rpc_clnt_submit doesn't think we're connected even when we - * are. It calls the socket code to reconnect, but the socket code tracks this - * stuff in a sane way so it knows we're connected and returns EINPROGRESS. - * Then we're stuck, connected but unable to use the connection. To make it - * work, we define and register this trivial callback. - */ Also, consumers of rpc know about state of connection only through the notifications sent by rpc-clnt. So, consumers don't have any extra information to manage the state and hence letting them manage the state is counter intuitive. This patch cleans that up and instead moves the responsibility of state management of rpc layer into itself. Change-Id: I31e641a60795fc480ca753917f4b2579f1e05094 Signed-off-by: Raghavendra G <rgowdapp@redhat.com> Fixes: bz#1585585
* rpc: Don't reset auth_value in disconnectKotresh HR2018-05-241-12/+48
| | | | | | | | | | | | | The auth_value was being reset to AUTH_GLUSTERFS_v2 during rpc disconnect. It shoud not be reset. The disconnect during portmap request can race with handshake. If handshake happens first and disconnect later, auth_value would set to default value and it never sets back to actual auth_value fixes: bz#1579276 Change-Id: Ib46c9e01a97f6defb3fd1e0423fdb4b899b4a361 Signed-off-by: Kotresh HR <khiremat@redhat.com>
* rpc: set listen-backlog to high valueMilind Changire2018-04-131-1/+1
| | | | | | | | | | | | | | | | | | | | Problem: On node reboot, when glusterd starts volumes rapidly, there's a flood of connections from the bricks to glusterd and from the self-heal daemons to the bricks. This causes SYN Flooding and dropped connections when the listen-backlog is not enough to hold the pending connections to compensate for the rate at which connections are accepted by the RPC layer. Solution: Increase the listen-backlog value to 1024. This is a partial solution. Part of the solution is to rearm the listener socket early for quicker accept() of connections. See commit 6964640a977cb10c0c95a94e03c229918fa6eca8 (change 19833) Change-Id: I62283d1f4990dd43839f9a6932cf8a36effd632c fixes: bz#1564600 Signed-off-by: Milind Changire <mchangir@redhat.com>
* rpc: rearm listener socket earlyMilind Changire2018-04-071-3/+3
| | | | | | | | | | | | | | | Problem: On node reboot, when glusterd starts volumes, a setup with a large number of bricks might cause SYN Flooding and connections to be dropped if the connections are not accepted quickly enough. Solution: accept() the connection and rearm the listener socket early to receive more connection requests as soon as possible. Change-Id: Ibed421e50284c3f7a8fcdb4de7ac86cf53d4b74e fixes: bz#1564600 Signed-off-by: Milind Changire <mchangir@redhat.com>
* rpc: update tirpc registration to "force" unregister old mapping before ↵Shreyas Siravara2018-03-282-0/+8
| | | | | | | | | | | | re-registering > Reviewed-on: https://review.gluster.org/16849 > Reviewed-by: Shreyas Siravara <sshreyas@fb.com> Change-Id: I05ed6b7c715a71e5819fbe8116e7c3146010f836 BUG: 1521030 Signed-off-by: Kevin Vigor <kvigor@fb.com> Signed-off-by: Amar Tumballi <amarts@redhat.com>
* rpc: simplify parameters when a saved frame is forced to unwindZhang Huan2018-03-281-4/+2
| | | | | | | | | When a saved frame is to be forced unwind, there is no need to pass an empty iovector without any data pointed to. Change-Id: I6e858fb38644326e22239b83272b15db656035e5 BUG: 1523122 Signed-off-by: Zhang Huan <zhanghuan@open-fs.com>
* rpc: fix incorrect return value when xdr decode failsZhang Huan2018-03-281-1/+0
| | | | | | | | | | | | | xdr_replymsg is called to decode reply message, and it returns failure if the message is corrupted. However, retrieving return value from the global errno is 0 even xdr_replymsg fails. Fix this issue by simply returning a negative value if call to xdr_replymsg fails. Change-Id: I2b9a1dc97652fbb6cf6568ea617f120713784a55 BUG: 1523122 Signed-off-by: Zhang Huan <zhanghuan@open-fs.com>
* socket: Improve error logging when loading SSL files failsNiklas Hambüchen2018-03-211-2/+6
| | | | | | | | | | * Say which file had the problem * Dump openssl error stack Fixes gluster/glusterfs#431. Change-Id: I66e9a0ae7758e9d7d8a5f19cc8ff898f01f2b491 Signed-off-by: Niklas Hambüchen <mail@nh2.me>
* glusterd: TLS verification fails while using intermediate CAMohit Agrawal2018-03-191-4/+8
| | | | | | | | | | | | | | | | | | | | | Problem: TLS verification fails while using intermediate CA if mgmt SSL is enabled. Solution: There are two main issue of TLS verification failing 1) not calling ssl_api to set cert_depth 2) The current code does not allow to set certificate depth while MGMT SSL is enabled. After apply this patch to set certificate depth user need to set parameter option transport.socket.ssl-cert-depth <depth> in /var/lib/glusterd/secure_acccess instead to set in /etc/glusterfs/glusterd.vol. At the time of set secure_mgmt in ctx we will check the value of cert-depth and save the value of cert-depth in ctx.If user does not provide any value in cert-depth in that case it will consider default value is 1 BUG: 1555154 Change-Id: I89e9a9e1026e37efb5c20f9ec62b1989ef644f35 Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
* cleanup: xlator_t structure's 'client_latency' variable is not usedSven Fischer2018-03-191-2/+0
| | | | | | | | | | | | | | | | | - Removed unused struct member and its one time usage. - cleaned up wrong white space member 'client_latency' was not used otherwise since it was added by commit 07cc8679cdf3b29680f4f105d0222da168d8bfc1 Author: Kevin Vigor <kvigor@fb.com> Date: Tue Mar 21 08:23:25 2017 -0700 Halo Replication feature for AFR translator Change-Id: Ibb0ea828d4090bbe8897f6af326b317884162a00 BUG: 1495153 Signed-off-by: Sven Fischer <sven@fischer-abc.de>
* build: address linkage issuesKaleb S. KEITHLEY2018-03-056-1/+170
| | | | | | | | | | | | | | | | | | | | | | | | | | | We have the following undefined symbol error from protocol/server.so: glusterfs_mgmt_pmap_signout glusterfs_autoscale_threads See https://review.gluster.org/19225 (bz#1532238) and https://review.gluster.org/19657 (bz#1550895) (why are there two different bzs for the same bug?) IMO this is a cleaner solution. I.e. moving the above two functions to libgfrpc (.../rpc/rpc-lib/...) I would also, for (foolish) consistency sake, like to see glusterfs_mgmt_pmap_signin() moved from glusterfsd to libgfrpc as well. This works on f28/rawhide, with its new, more restrictive run-time link semantics. The smoke and regression tests on earlier fedora and centos will confirm that it works on those platforms too. Change-Id: I9cfbd1cc15e7ebd9fc31b56ac791287fa2c584de BUG: 1550895 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
* rpcsvc: scale rpcsvc_request_handler threadsMilind Changire2018-02-263-17/+123
| | | | | | | | | | | | Scale rpcsvc_request_handler threads to match the scaling of event handler threads. Please refer to https://bugzilla.redhat.com/show_bug.cgi?id=1467614#c51 for a discussion about why we need multi-threaded rpcsvc request handlers. Change-Id: Ib6838fb8b928e15602a3d36fd66b7ba08999430b Signed-off-by: Milind Changire <mchangir@redhat.com>
* socket: options update for GD2Mohit Agrawal2018-02-191-4/+36
| | | | | | | All socket options update for GD2 Change-Id: I227c16965e92018a5ab5aacd9c2617fb2735268c Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
* Fetch backup volfile servers from glusterd2Prashanth Pai2018-02-161-0/+5
| | | | | | | | | | | | | | | | Clients will request for a list of volfile servers from glusterd2 by setting a (optional) flag in GETSPEC RPC call. glusterd2 will check for the presence of this flag and accordingly return a list of glusterd2 servers in GETSPEC RPC reply. Currently, this list of servers returned only contains servers which have bricks belonging to the volume. See: https://github.com/gluster/glusterd2/issues/382 https://github.com/gluster/glusterfs/issues/351 Updates #351 Change-Id: I0eee3d0bf25a87627e562380ef73063926a16b81 Signed-off-by: Prashanth Pai <ppai@redhat.com>
* rpc: Adds rpcbind6 programs to libgfrpc symbolsSheena Artrip2018-02-131-0/+2
| | | | | | | | | | | | | Building with --with-default-ipv6 causes shared components of gluster calling the rpcbind6 functions to fail. Adding the symbols in the list is all that is necessary. Building without ipv6 keeps the same behavior. No test cases as this is a build-specific fix. Change-Id: I248d3291bf17326b07d152d9b79cdcfaf9068f0d BUG: 1544961 Signed-off-by: Sheena Artrip <sheenobu@fb.com>
* protocol: utilize the version 4 xdrAmar Tumballi2018-02-013-2/+151
| | | | | | | updates #384 Change-Id: Id80bf470988dbecc69779de9eb64088559cb1f6a Signed-off-by: Amar Tumballi <amarts@redhat.com>
* protocol: Implement put fopPoornima G2018-01-313-0/+14
| | | | | | Updates #353 Change-Id: I755b9208690be76935d763688fa414521eba3a40 Signed-off-by: Poornima G <pgurusid@redhat.com>
* build: Add new glusterfs4 source files to gitignoreAnoop C S2018-01-301-0/+2
| | | | | Change-Id: I4e6439d0f1ab55528c0f7e23c437c7b62628b8e4 Signed-off-by: Anoop C S <anoopcs@redhat.com>
* build: restore ability to control verbosity settingsJan Engelhardt2018-01-261-2/+2
| | | | | | | | | | | | | | | `make V=1` is broken — no commands are printed whatsoever. At the same time, `make V=0` *also* is broken in that no summary lines ("CC  foo.o") are printed, either. Kill the annoying hardcoded --quiet in configure.ac, since it seems to override everything that automake offers. Change-Id: I377c0e0469619a33586afb4a93dde6d241e7bc21 Fixes: #381 BUG: 1539023 Original-author: Jan Engelhardt <jengelh@inai.de> Signed-off-by: Niels de Vos <ndevos@redhat.com> [ndevos: silence rpc/xdr/gen rpgcen]
* build: use libtirpc by default, even if ipv6 is not the defaultKaleb S. KEITHLEY2018-01-261-1/+1
| | | | | | | | | | | | | | Another error snuck in with Change-Id I86f847dfd, or more accurately I think, with Change-Id: Ic47065e9c2... All libs, not just libgfrpc, need to be linked with libtirpc, especially on systems that still have xdr functions in (g)libc where you will get a mixture of calls to libtirpc functions and glibc functions, with catastrophic results. BUG: 1536186 Change-Id: I97dc39c7844f44c36fe210aa813480c219e1e415 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
* protocol: make on-wire-change of protocol using new XDR definition.Amar Tumballi2018-01-193-29/+1169
| | | | | | | | | | | | | | | | | | | | | | With this patchset, some major things are changed in XDR, mainly: * Naming: Instead of gfs3/gfs4 settle for gfx_ for xdr structures * add iattx as a separate structure, and add conversion methods * the *_rsp structure is now changed, and is also reduced in number (ie, no need for different strucutes if it is similar to other response). * use proper XDR methods for sending dict on wire. Also, with the change of xdr structure, there are changes needed outside of xlator protocol layer to handle these properly. Mainly because the abstraction was broken to support 0-copy RDMA with payload for write and read FOP. This made transport layer know about the xdr payload, hence with the change of xdr payload structure, transport layer needed to know about the change. Updates #384 Change-Id: I1448fbe9deab0a1b06cb8351f2f37488cefe461f Signed-off-by: Amar Tumballi <amarts@redhat.com>
* rpc/*: auth-header changesAmar Tumballi2018-01-179-119/+388
| | | | | | | | | | | | | | | | | Introduce another authentication header which can now send more data. This is useful because this data can be common for all the fops, and we don't need to change all the signatures. As part of this, made rpc-clnt.c little more modular to support multiple authentication structures. stack.h changes are placeholder for the ctime etc, can be moved later based on need. updates #384 Change-Id: I6111c13cfd2ec92e2b4e9295896bf62a8a33b2c7 Signed-off-by: Amar Tumballi <amarts@redhat.com>
* dict: add another type to handle backward compatibilityAmar Tumballi2018-01-171-0/+3
| | | | | | | | | | | | | | | | This new type helps to avoid excessive logs. It should be set only in case of * volume graph building (graph.y) * dict unserialize (happens once a dictionary is received on wire in old protocol) All other dict set and get should have proper check and warning logs if there is a mismatch. updates #220 Change-Id: I1cccb304a877aa80c07aaac95f10f5005e35b9c5 Signed-off-by: Amar Tumballi <amarts@redhat.com>
* locks: added inodelk/entrylk contention upcall notificationsXavier Hernandez2018-01-164-0/+179
| | | | | | | | | | | | | | The locks xlator now is able to send a contention notification to the current owner of the lock. This is only a notification that can be used to improve performance of some client side operations that might benefit from extended duration of lock ownership. Nothing is done if the lock owner decides to ignore the message and to not release the lock. For forced release of acquired resources, leases must be used. Change-Id: I7f1ad32a0b4b445505b09908a050080ad848f8e0 Signed-off-by: Xavier Hernandez <xhernandez@datalab.es>