summaryrefslogtreecommitdiffstats
path: root/xlators
Commit message (Collapse)AuthorAgeFilesLines
* features/cloudsync : Added some new functionsAnuradha Talur2019-04-107-94/+597
| | | | | | | | | | | | | This patch contains the following changes: 1) Store ID info will now be stored in the inode ctx 2) Added new readv type where read is made directly from the remote store. This choice is made by volume set operation. 3) cs_forget() was missing. Added it. Change-Id: Ie3232b3d7ffb5313a03f011b0553b19793eedfa2 fixes: bz#1642168 Signed-off-by: Anuradha Talur <atalur@commvault.com>
* storage/posix: changes with respect to cloudsyncAnuradha Talur2019-04-104-15/+177
| | | | | | | | | | Main changes include logic to update iatt buf with file size from extended attributes in posix rather than having this logic in cloudsync xlator. Change-Id: I44f5f8df7a01e496372557fe2f4eff368dbdaa33 fixes: bz#1642168 Signed-off-by: Anuradha Talur <atalur@commvault.com>
* mgmt/glusterd: Make changes related to cloudsync xlatorAnuradha Talur2019-04-101-12/+12
| | | | | | | | | | 1) The placement of cloudsync xlator has been changed to make it shard xlator's child. If cloudsync has to work with shard in the graph, it needs to be child of shard. Change-Id: Ib55424fdcb7ce8edae9f19b8a6e3d3ba86c1f0c4 fixes: bz#1642168 Signed-off-by: Anuradha Talur <atalur@commvault.com>
* protocol: add an option to force using old-protocolAmar Tumballi2019-04-103-3/+24
| | | | | | | | | | | | | | As protocol implements every fop, and in general a large part of the codebase. Considering our regression is run mostly in 1 machine, there was no way of forcing the client to use old protocol (while new one is available). With this patch, a new 'testing' option is provided which forces client to use old protocol if found. This should help increase the code coverage by at least 10k lines overall. updates: bz#1693692 Change-Id: Ie45256f7dea250671b689c72b4b6f25037cef948 Signed-off-by: Amar Tumballi <amarts@redhat.com>
* build: glusterfs build is failing on RHEL-6Mohit Agrawal2019-04-101-1/+1
| | | | | | | | | | | Problem: glusterfs build is throwing error undefined reference to `dlclose' on RHEL 6 Solution: Add LIB_DL link in Makefile.am to resolve the same Fixes: bz#1696512 Change-Id: I58019ca9e29d569d8e6df282b8ab178ad540843b Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
* glusterd: load ctime in the client graph only if it's not turned offAtin Mukherjee2019-04-091-1/+2
| | | | | | | | | | | Considering ctime is a client side feature, we can't blindly load ctime xlator into the client graph if it's explicitly turned off, that'd result into backward compatibility issue where an old client can't mount a volume configured on a server which is having ctime feature. Fixes: bz#1697907 Change-Id: I6ae7b96d056073aa6746de9a449cf319786d45cc Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
* glusterd-volgen.c: skip fetching skip-CLIOT in a loop.Yaniv Kaul2019-04-081-2/+3
| | | | | | | | | | Its value is not going to change within the loop, as far as I can understand the code. Fetch and store it outside the loop. Change-Id: I6327c23212dceec6006349421ef185495892dd8a updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
* glusterd: remove redundant glusterd_check_volume_exists () callsAtin Mukherjee2019-04-086-117/+23
| | | | | | | | | | | | | | | | | | A pattern of following was found in multiple places where both glusterd_check_volume_exists and glusterd_volinfo_find do the same job. We just need one of them not both. In a scaled environment having many volumes this is a bottleneck to iterate over the volume list to find a volume twice! exists = glusterd_check_volume_exists(volname); ret = glusterd_volinfo_find(volname, &volinfo); if ((ret) || (!exists)) { Credits: ykaul@redhat.com for finding this out Updates: bz#1193929 Change-Id: Ie116fe5c93e261a2bddd267c28ccb20a2884a36f Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
* GlusterD: Resolves the issue of referencing memory after it has been freedrishubhjain2019-04-081-4/+0
| | | | | | | | | | | Setting the pointer to NULL after GF_FREE() and checking the pointer value before calling GF_FREE() to avoid referencing memory after its has been freed CID: 1398622 Change-Id: Iba0d8879abccf5923a69132a207d53bb94551417 updates: bz#789278 Signed-off-by: rishubhjain <rishubhjain47@gmail.com>
* cluster/dht: refactor dht lookup functionsN Balachandran2019-04-052-124/+119
| | | | | | | | | | Part 1: refactor the dht_lookup_dir_cbk and dht_selfheal_directory functions. Added a simple dht selfheal directory test Change-Id: I1410c26359e3c14b396adbe751937a52bd2fcff9 updates: bz#1590385 Signed-off-by: N Balachandran <nbalacha@redhat.com>
* cluster/afr: Invalidate inode on change of split-brain-choicePranith Kumar K2019-04-051-4/+1
| | | | | | | | | | | When split-brain choice is changed from one brick to another brick, inode-invalidate is not called so readv call is served from cache leading to failures in split-brain-resolution.t. Fixed it by calling inode_invaldate() when this happens. updates bz#1193929 Change-Id: I2624614eec38c0303f3e1dc55dfae3d4b864218b Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
* cluster/ec: Fix handling of heal info cases without locksAshish Pandey2019-04-041-25/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we use heal info command, it takes lot of time as in some cases it takes lock on entries to find out if the entry actually needs heal or not. There are some cases where we can avoid these locks and can conclude if the entry needs heal or not. 1 - We do a lookup (without lock) on an entry, which we found in .glusterfs/indices/xattrop, and find that lock count is zero. Now if the file contains dirty bit set on all or any brick, we can say that this entry needs heal. 2 - If the lock count is one and dirty is greater than 1, then it also means that some fop had left the dirty bit set which made the dirty count of current fop (which has taken lock) more than one. At this point also we can definitely say that this entry needs heal. This patch is modifying code to take into consideration above two points. It is also changing code to not to call ec_heal_inspect if ec_heal_do was called from client side heal. Client side heal triggeres heal only when it is sure that it requires heal. [We have changed the code to not to call heal for lookup] updates bz#1689799 Change-Id: I7f09f0ecd12f65a353297aefd57026fd2bebdf9c Signed-off-by: Ashish Pandey <aspandey@redhat.com>
* sdfs: enable pass-throughAmar Tumballi2019-04-031-0/+5
| | | | | | | | | | | we have 'sdfs-sanity.t' which covers at least 90% of the functions and 70% of lines in the translator. But the recent changes to disable it due to performance impact made even the test to not consider the translator. updates: bz#1693692 Change-Id: I0ebcb307c4ab48a6e59ded27bf39f72ce2304ebc Signed-off-by: Amar Tumballi <amarts@redhat.com>
* changelog: remove unused code.Yaniv Kaul2019-04-034-32/+0
| | | | | | | | Seems to be unused. Change-Id: I75eed9641dd030a1fbb1b942a9d818f10a7e1437 updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
* posix-acl: remove default functions, and use library fn insteadAmar Tumballi2019-04-031-165/+18
| | | | | | | | | | | this works as a better solution, as we reuse more functions from library. Also just do write/read on a file when acl is enabled, so we can see improvement in code coverage. updates: bz#1693692 Change-Id: If3359260c8ec2cf4fcf148fb4b95fdecc922c252 Signed-off-by: Amar Tumballi <amarts@redhat.com>
* cluster/afr: Send inodelk/entrylk with non-zero lk-ownerPranith Kumar K2019-04-022-12/+48
| | | | | | | | | | | | | | Found missing assignment of lk-owner for an inodelk/entrylk before winding the fops. locks xlator at the moment allows this operation. This leads to multiple threads in the same client being able to get locks on the inode because lk-owner is same and transport is same. So isolation with locks can't be achieved. To fix it, we need locks xlator change which will disallow null-lk-owner based inodelk/entrylk/lk. To achieve that we need to first fix all the places which do this mistake. updates bz#1624701 Change-Id: Ic3431da3f451a1414f1f4fdcfc4cf41e555f69dd Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
* mgmt/shd: Implement multiplexing in self heal daemonMohammed Rafi KC2019-04-0131-242/+2030
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Shd daemon is per node, which means they create a graph with all volumes on it. While this is a great for utilizing resources, it is so good in terms of performance and managebility. Because self-heal daemons doesn't have capability to automatically reconfigure their graphs. So each time when any configurations changes happens to the volumes(replicate/disperse), we need to restart shd to bring the changes into the graph. Because of this all on going heal for all other volumes has to be stopped in the middle, and need to restart all over again. Solution: This changes makes shd as a per volume daemon, so that the graph will be generated for each volumes. When we want to start/reconfigure shd for a volume, we first search for an existing shd running on the node, if there is none, we will start a new process. If already a daemon is running for shd, then we will simply detach a graph for a volume and reatach the updated graph for the volume. This won't touch any of the on going operations for any other volumes on the shd daemon. Example of an shd graph when it is per volume graph ----------------------- | debug-iostat | ----------------------- / | \ / | \ --------- --------- ---------- | AFR-1 | | AFR-2 | | AFR-3 | -------- --------- ---------- A running shd daemon with 3 volumes will be like--> graph ----------------------- | debug-iostat | ----------------------- / | \ / | \ ------------ ------------ ------------ | volume-1 | | volume-2 | | volume-3 | ------------ ------------ ------------ Change-Id: Idcb2698be3eeb95beaac47125565c93370afbd99 fixes: bz#1659708 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
* protocol/client: Do not fallback to anon-fd if fd is not openPranith Kumar K2019-03-311-1/+7
| | | | | | | | | | | | | | | | | | If an open comes on a file when a brick is down and after the brick comes up, a fop comes on the fd, client xlator would still wind the fop on anon-fd leading to wrong behavior of the fops in some cases. Example: If lk fop is issued on the fd just after the brick is up in the scenario above, lk fop will be sent on anon-fd instead of failing it on that client xlator. This lock will never be freed upon close of the fd as flush on anon-fd is invalid and is not wound below server xlator. As a fix, failing the fop unless the fd has FALLBACK_TO_ANON_FD flag. Change-Id: I77692d056660b2858e323bdabdfe0a381807cccc fixes bz#1390914 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
* afr: thin-arbiter read txn fixesRavishankar N2019-03-293-22/+37
| | | | | | | | | | | | | - Fixes afr_ta_read_txn() to handle inode refresh failures. code-path. - Fixes a double free issue of dict. Note: This patch address post-merge review comments for commit 69532c141be160b3fea03c1579ae4ac13018dcdf fixes: bz#1686398 Change-Id: Id5299b45b68569d47df6b73755918237a1592cb4 Signed-off-by: Ravishankar N <ravishankar@redhat.com>
* mount.glusterfs: change the error messageAmar Tumballi2019-03-291-2/+7
| | | | | | | | | | | | | | | In scenarios where a mount fails before creating log file, doesn't make sense to give message to 'check log file'. See below: ``` ERROR: failed to create logfile "/var/log/glusterfs/mnt.log" (No space left on device) ERROR: failed to open logfile /var/log/glusterfs/mnt.log Mount failed. Please check the log file for more details. ``` Fixes: bz#1688068 Change-Id: I1d837caa4f9bc9f1a37780783e95007e01ae4e3f Signed-off-by: Amar Tumballi <amarts@redhat.com>
* client-rpc: Fix the payload being sent on the wirePoornima G2019-03-296-244/+308
| | | | | | | | | | | | | | | | | | | The fops allocate 3 kind of payload(buffer) in the client xlator: - fop payload, this is the buffer allocated by the write and put fop - rsphdr paylod, this is the buffer required by the reply cbk of some fops like lookup, readdir. - rsp_paylod, this is the buffer required by the reply cbk of fops like readv etc. Currently, in the lookup and readdir fop the rsphdr is sent as payload, hence the allocated rsphdr buffer is also sent on the wire, increasing the bandwidth consumption on the wire. With this patch, the issue is fixed. Fixes: bz#1692093 Change-Id: Ie8158921f4db319e60ad5f52d851fa5c9d4a269b Signed-off-by: Poornima G <pgurusid@redhat.com>
* rpc: Remove duplicate codePranith Kumar K2019-03-281-1/+1
| | | | | | | | | | rpc_clnt_disable() and rpc_clnt_disconnect() have same code. Removed rpc_clnt_disconnect() and moved calls to rpc_clnt_disconnect() to rpc_clnt_disable() updates bz#1193929 Change-Id: I965f57cc1d5af36d266810125558b6f5e5f279d4 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
* glusterd: fix potential locking issue on peer probeZhang Huan2019-03-272-3/+5
| | | | | | | | | | | There are two cases to restart brick, one is when glusterd starts or quorum is met, another is when new peers are joined and quorum is changes. In the later case, sync_lock is not taken, and may cause lock corruption. Change-Id: I0844e7a631350f5ee00bdacb613602bffffcdf9f fixes: bz#1692612 Signed-off-by: Zhang Huan <zhanghuan@open-fs.com>
* cluster/ec: Don't enqueue an entry if it is already healingAshish Pandey2019-03-275-30/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: 1 - heal-wait-qlength is by default 128. If shd is disabled and we need to heal files, client side heal is needed. If we access these files that will trigger the heal. However, it has been observed that a file will be enqueued multiple times in the heal wait queue, which in turn causes queue to be filled and prevent other files to be enqueued. 2 - While a file is going through healing and a write fop from mount comes on that file, it sends write on all the bricks including healing one. At the end it updates version and size on all the bricks. However, it does not unset dirty flag on all the bricks, even if this write fop was successful on all the bricks. After healing completion this dirty flag remain set and never gets cleaned up if SHD is disabled. Solution: 1 - If an entry is already in queue or going through heal process, don't enqueue next client side request to heal the same file. 2 - Unset dirty on all the bricks at the end if fop has succeeded on all the bricks even if some of the bricks are going through heal. Change-Id: Ia61ffe230c6502ce6cb934425d55e2f40dd1a727 updates: bz#1593224 Signed-off-by: Ashish Pandey <aspandey@redhat.com>
* afr: add client-pid to all gf_event() callsRavishankar N2019-03-277-15/+38
| | | | | | | | | client-pid for glustershd is GF_CLIENT_PID_SELF_HEALD client-pid for glfsheal is GF_CLIENT_PID_GLFS_HEALD updates: bz#1689250 Change-Id: Ib3a863af160ff48c822a5e6b0c27c575c9887470 Signed-off-by: Ravishankar N <ravishankar@redhat.com>
* cluster/afr: Remove un-used variables related to pumpPranith Kumar K2019-03-261-3/+0
| | | | | | updates bz#1193929 Change-Id: I01b60d644f517c00a1bcc127bf9a8ed90b6eb7a0 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
* glusterd: fix txn-id mem leakAtin Mukherjee2019-03-252-6/+36
| | | | | | | | | | | | | | | This commit ensures the following: 1. Don't send commit op request to the remote nodes when gluster v status all is executed as for the status all transaction the local commit gets the name of the volumes and remote commit ops are technically a no-op. So no need for additional rpc requests. 2. In op state machine flow, if the transaction is in staged state and op_info.skip_locking is true, then no need to set the txn id in the priv->glusterd_txn_opinfo dictionary which never gets freed. Fixes: bz#1691164 Change-Id: Ib6a9300ea29633f501abac2ba53fb72ff648c822 Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
* Multiple files: remove HAVE_BD_XLATOR related code.Yaniv Kaul2019-03-256-383/+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
* fuse : fix high sev coverity issueSunny Kumar2019-03-211-1/+7
| | | | | | | | | | | | This patch fixed coverity issue in fuse-bridge.c. CID : 1398630 : Resource leak CID : 1399757 : Uninitialized pointer read updates: bz#789278 Change-Id: I69f8591400ee56a5d215eeac443a8e3d7777db27 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
* server.c: fix Coverity CID 1399758Yaniv Kaul2019-03-211-1/+2
| | | | | | | | | | | | 1399758 Dereference before null check It was introduced @ commit 67f48bfcc16a38052e6c9ae7c25e69b03b8ae008 updates: bz#789278 Signed-off-by: Yaniv Kaul <ykaul@redhat.com> Change-Id: I1424b008b240691fe2a8924e31c708d0fb4f362d
* rpc/transport: Missing a ref on dict while creating transport objectMohammed Rafi KC2019-03-2010-14/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* glusterd-locks: misc. changes.Yaniv Kaul2019-03-192-64/+51
| | | | | | | | | | Move to use dict_*n() functions, where it made sense. Compile-tested only! updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com> Change-Id: Ie9c4b2021d2229ea9a815cc75e9eb8c3945c109e
* mount/fuse: Fix spelling mistakePranith Kumar K2019-03-151-1/+2
| | | | | | updates bz#1193929 Change-Id: I55ffa8f086ad9570f2526d91c196d7de9ffe6add Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
* geo-rep: IPv6 supportAravinda VK2019-03-151-2/+28
| | | | | | | | | | | | | `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>
* shard: fix crash caused by using null inodeKinglong Mee2019-03-141-4/+3
| | | | | | Change-Id: I156bf962223304e586b83a36be59a0ca74589b43 Updates: bz#1688287 Signed-off-by: Kinglong Mee <mijinlong@open-fs.com>
* cluster/afr : TA: Return actual error code in case of failureAshish Pandey2019-03-141-6/+6
| | | | | | | | | In afr_ta_post_op_do, we were sending EIO for every failure. However, the original error code should be sent. Change-Id: I9fdc15dac00d758baf8e6f14db244f526481a63a updates: bz#1686711 Signed-off-by: Ashish Pandey <aspandey@redhat.com>
* storage/posix: Remove nr_files usagePranith Kumar K2019-03-144-7/+0
| | | | | | | | | | | | | | | | nr_files is supposed to represent the number of files opened in posix. Present logic doesn't seem to handle anon-fds because of which the counts would always be wrong. I don't remember anyone using this value in debugging any problem probably because we always have 'ls -l /proc/<pid>/fd' which not only prints the fds that are active but also prints their paths. It also handles directories and anon-fds which actually opened the file. So removing this code instead of fixing the buggy logic to have the nr_files. fixes bz#1688106 Change-Id: Ibf8713fdfdc1ef094e08e6818152637206a54040 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
* glusterfsd: Brick is getting crash at the time of startupMohit Agrawal2019-03-131-5/+5
| | | | | | | | | | | | Problem: Brick is getting crash because graph was not activated at the time of accessing server_conf Solution: To avoid the crash check ctx->active before processing a request Change-Id: Ib112e0eace19189e45f430abdac5511c026bed47 fixes: bz#1687705 Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
* dht: NULL check before setting error flagMohammed Rafi KC2019-03-121-1/+2
| | | | | | | | | | | Function dht_common_mark_mdsxattr blindly setting value for an integer pointer without validating it. In fact there are two callers of this function that passes NULL value to the same pointer which leads to a crash. Change-Id: Id94ffe216f6a21f007b3291bff0b1e1c1989075c fixes: bz#1687811 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
* io-threads.c: Potentially skip a lock.Yaniv Kaul2019-03-121-12/+13
| | | | | | | | | | | | | | | Before going into the lock, verify stub_cnt != 0. Otherwise, let's skip this code. Unrelated, switch a CALLOC to MALLOC, as we initialize all members right away. This allocation is done also under lock, so also should help a bit. Compile-tested only! updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com> Change-Id: Ie2fe6adff41ae4969abff95eff945b54e1a01d32
* cluster/afr: Send truncate on arbiter brick from SHDkarthik-us2019-03-111-15/+13
| | | | | | | | | | | | | | | | | | | Problem: In an arbiter volume configuration SHD will not send any writes onto the arbiter brick even if there is data pending marker for the arbiter brick. If we have a arbiter setup on the geo-rep master and there are data pending markers for the files on arbiter brick, SHD will not mark any data changelog during healing. While syncing the data from master to slave, if the arbiter-brick is considered as ACTIVE, then there is a chance that slave will miss out some data. If the arbiter brick is being newly added or replaced there is a chance of slave missing all the data during sync. Fix: If there is data pending marker for the arbiter brick, send truncate on the arbiter brick during heal, so that it will record truncate as the data transaction in changelog. Change-Id: I3242ba6cea6da495c418ef860d9c3359c5459dec fixes: bz#1686568 Signed-off-by: karthik-us <ksubrahm@redhat.com>
* rpm: add thin-arbiter packageAmar Tumballi2019-03-111-2/+0
| | | | | | | | | | | | | | | | | | | Discussion on thin arbiter volume - https://github.com/gluster/glusterfs/issues/352#issuecomment-350981148 Main idea of having this rpm package is to deploy thin-arbiter without glusterd and other commands on a node, and all we need on that tie-breaker node is to run a single glusterfs command. Also note that, no other glusterfs installation needs thin-arbiter.so. Make sure RPM contains sample vol file, which can work by default, and a script to configure that volfile, along with translator image. Change-Id: Ibace758373d8a991b6a19b2ecc60c93b2f8fc489 updates: bz#1674389 Signed-off-by: Amar Tumballi <amarts@redhat.com> Signed-off-by: Ashish Pandey <aspandey@redhat.com>
* cluster/afr: Add quorum checks to open & opendir fopskarthik-us2019-03-084-2/+48
| | | | | | | | | | | | | | | Problem: Currently even if open & opendir fails on quorum number of bricks, but succeeds on atleast one brick, it will result in success. This leads to inconsistency in the behaviour with other operations following the open, which has quorum checks. Fix: Add quorum checks to open & opendir fops to avoid inconsistency. Change-Id: If8fcb82072a6dc45ea6d4a6754b79763215eba2a fixes: bz#1634664 Signed-off-by: karthik-us <ksubrahm@redhat.com>
* performance/readdir-ahead: fix deadlockRaghavendra Gowdappa2019-03-071-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | This deadlock happens while processing dentry corresponding to current directory (.) in rda_fill_readdirp. In this case following order is followed: LOCK(directory_fd_ctx->lock); rda_inode_ctx_get_iatt -> LOCK(directory_inode->lock); However, in rda_mark_inode_dirty following lock order is followed: LOCK(directory_inode->lock); LOCK(directory_fd_ctx->lock); these two codepaths when executed concurrently resulted in a deadlock. Current patch fixes this by removing locking directory inode and fd-ctx in rda_fill_readdirp. This is fine as directory inode's stat won't change due to writes to files within directory. Change-Id: Ic93a67a0dac8229bb0d79582e526a512e6f2569c fixes: bz#1674412 Signed-off-by: Raghavendra Gowdappa <rgowdapp@redhat.com> Fixes:bz#1674412
* WORM-Xlator: Maybe integer overflow when computing new atimeDavid Spisla2019-03-072-8/+8
| | | | | | | | | | | | | | | | | | | | The structs worm_reten_state_t and read_only_priv_t from read-only.h are using uint64_t values to store periods of retention and autocommmit. This seems to be dangerous since in worm-helper.c the function worm_set_state computes in line 97: stbuf->ia_atime = time(NULL) + retention_state->ret_period; stbuf->ia_atime is using int64_t because of the settings of struct iattr. So if there is a very very high retention period stored, there is maybe an integer overflow. What can be the solution? Using int64_t instead if uint64_t may reduce the probability of the occurance. Change-Id: Id1e86c6b20edd53f171c4cfcb528804ba7881f65 fixes: bz#1685944 Signed-off-by: David Spisla <david.spisla@iternity.com>
* core: make compute_cksum function op_version compatibleSanju Rakonde2019-03-071-4/+8
| | | | | | | | | | | | | | | Problem: commit 5a152a changed the mechansim of computing the checksum. In heterogeneous cluster, peers are running into rejected state because we have different cksum computation mechansims in upgraded and non-upgraded nodes. Solution: add a check for op-version so that all the nodes in the cluster follow the same mechanism for computing the cksum. Change-Id: I1508f000e8c9895588b6011b8b6cc0eda7102193 fixes: bz#1685120 Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* leases: Do not process internal fopsSoumya Koduri2019-03-052-0/+26
| | | | | | | | | | fops marked internal are used to maintain data integrity and ideally do not intervene with application client leases. Hence it seems safe to ignore them by lease xlator. Change-Id: I887b6f2da7ec0081442cc4b572a7a9e110f79eb2 updates: bz#1648768 Signed-off-by: Soumya Koduri <skoduri@redhat.com>
* glusterd: glusterd memory leak while running "gluster v profile" in a loopMohit Agrawal2019-03-052-3/+6
| | | | | | | | | | | Problem: glusterd has memory leak while running "gluster v profile" in a loop Solution: Resolve leak code path to avoid leak Change-Id: Id608703ff6d0ad34ed8f921a5d25544e24cfadcd fixes: bz#1685414 Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
* io-threads: Prioritize fops with NO_ROOT_SQUASH pidSusant Palai2019-03-051-1/+3
| | | | | | | | | | | | | | | | | | | | | | There was 30% regression observed in mkdir path with commit b139bc58eb504adf5ef81658896c9283ae21f390. On analysis it is found that io-threads xlator deprioritzes fops with all -ve pid. Some context in to the no-root-squash pid requirement: DHT xlator does some of the internal fops with root privileges. This is needed so that operations like layout healing should not be abandoned because a non root user is operating. If root-squash option is enabled the layout set operation looses its root privilege as server xlator converts the uid and pid to random numbers. Hence, the above mentioned commit converted pid to GF_CLIENT_PID_NO_ROOT_SQUASH to continue fops as root. Combining the above I am proposing not to deprioritize fops with no-root-squash pid. Change-Id: I54d056c01b25729304a77f9242fbaff39c5672ba fixes: bz#1676430 Signed-off-by: Susant Palai <spalai@redhat.com>
* afr: mark changelog_fsync as internalSoumya Koduri2019-03-051-1/+3
| | | | | | | | | | As afr_changelog_fsync is used for internal operations, use GLUSTERFS_INTERNAL_FOP_KEY so that lease xlator can avoid treating it as conflicting fop and recall lease. Change-Id: I52cdc161002e840199d24439231a8bfa4f98b1b6 updates: bz#1648768 Signed-off-by: Soumya Koduri <skoduri@redhat.com>