summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* nfs/server: NULL pointer dereferencing clang fixShwetha Acharya2018-09-212-2/+2
| | | | | | | Added some condition checks in nfs3.c and nlm4.c Updates: bz#1622665 Change-Id: Ia10b8fff14f651df1360c9bb79d4476b282f54b5 Signed-off-by: Shwetha Acharya <sacharya@redhat.com>
* block : fix coverity in bd.cSunny Kumar2018-09-211-0/+6
| | | | | | | | | This patch fixes CID 1288097, 1128921, and 1128918 all of type RESOURCE_LEAK. Change-Id: If39be19c6310eab9880de6f0bebb4f38604a40b2 updates: bz#789278 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
* cluster/afr: Make data eager-lock decision based on number of locksPranith Kumar K2018-09-213-6/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For both Virt and block workloads the file is opened multiple times leading to dynamically setting eager-lock to off for the workload. Instead of depending on the number-of-open-fds, if we change the logic to depend on number of inodelks, then it will give better performance than the earlier logic. When there is an eager-lock and number of inodelks is more than 1 we know that there is a conflicting lock, so depend on that information to decide whether to keep the current transaction go through delayed-post-op or not. Locks xlator doesn't have implementation to query number of locks in fxattrop in releases older than 3.10 so to keep things backward compatible in 3.12, data transactions will use new logic where as fxattrop transactions will use old logic. I am planning to send one more patch which makes metadata domain locks also depend on inodelk-count Profile info for a dd of 500MB to a file with another fd opened on the file using exec 250>filename Without this patch: 0.14 67.41 us 16.72 us 3870.82 us 892 FINODELK 0.59 279.87 us 95.71 us 2085.89 us 898 FXATTROP 3.46 366.43 us 81.75 us 6952.79 us 4000 WRITE 95.79 148733.99 us 50568.12 us 919127.86 us 273 FSYNC With this patch: 0.00 51.01 us 38.07 us 80.16 us 4 FINODELK 0.00 235.43 us 235.43 us 235.43 us 1 TRUNCATE 0.00 125.07 us 56.80 us 193.33 us 2 GETXATTR 0.00 135.86 us 62.13 us 209.59 us 2 INODELK 0.00 197.88 us 155.39 us 253.90 us 4 FXATTROP 0.00 450.59 us 394.28 us 506.89 us 2 XATTROP 0.00 56.96 us 19.06 us 406.59 us 23 FLUSH 37.81 273648.93 us 48.43 us 6017657.05 us 44 LOOKUP 62.18 4951.86 us 93.80 us 1143154.75 us 3999 WRITE postgresql benchmark performance changed from ~1130 TPS to ~2300TPS randio fio job inside Ovirt based VM went from ~600IOPs to ~2000IOPS fixes bz#1630368 Change-Id: If7f7388d2f08cf7f17ca517a4ea222560661dc36 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
* extras: Add new options to group "virt"Krutika Dhananjay2018-09-211-0/+3
| | | | | | | | | | | | | In some of the recent performance tests on gluster-as-vm-image-store use-case, it has been observed that sometimes the lone fuse thread can hit near-100% CPU utilization and become a performance bottleneck. Enabling client-io-threads (in addition to bumping up epoll threads on server and client side) has shown to be helpful in getting around this bottleneck and pushing more IOPs. Change-Id: I231db309de0e37c79cd44f5666da4cd776fefa04 fixes: bz#1630798 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
* dht: Operate internal fops with negative pidSusant Palai2018-09-202-0/+4
| | | | | | | | | | | | | | | | | | | With root-squash on, all root credentials are converted to a random uid, gid(65535). And ideally this does not carry the necessary permission bits to carry out the operation. But posix-acl will allow operations from this inode as long as its ctx has the ngroup information and ngroup has the owner group information. The problem we ran into recently was somehow posix-acl xlator did not cache the ngroup info and some of the dht internal fops(layout setxattr) failed with root-squash enabled. DHT internal fops now use a negative pid to pretend that the operation is from an internal client so posix-acl allows them to pass Change-Id: I5bb8d068389bf4c94629d668a16015a95ccb53ab fixes: bz#1624796 Signed-off-by: Susant Palai <spalai@redhat.com>
* tests: fix test case failureSanju Rakonde2018-09-201-1/+1
| | | | | | | | | | | | | | | | tests/bugs/glusterd/bug-1595320.t is failing in downstream. In downstream repo, enabling the brick multiplexing made interactive, so it will throw an prompt for the user input. As no input is provided during the test case execution, the test is failing. Using macro CLI instead of using gluster command, will bypass the interacive commands. so replacing the gluster command with CLI macro will address the issue. Change-Id: I6b39052d8e415a8ed08de7c80a91dadce155146a updates: bz#1193929 Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* Quota: NULL pointer dereferencing clang FixHarpreet Lalwani2018-09-201-1/+2
| | | | | | | | | Added ternary operator to avoid NULL pointer dereferencing Updates: bz#1622665 Change-Id: I903ec1973fd4bb6473d16e2680bd86ac3a20e093 Signed-off-by: Harpreet Lalwani <hlalwani@redhat.com>
* storage/posix: Check if fd->inode is NULL before using itAshish Pandey2018-09-201-4/+4
| | | | | | | | | | | CID: 1395473, 1395472 https://scan6.coverity.com/reports.htm#v42607/p10714/fileInstanceId=85588219&defectInstanceId=26115956&mergedDefectId=1395472 https://scan6.coverity.com/reports.htm#v42607/p10714/fileInstanceId=85588219&defectInstanceId=26115961&mergedDefectId=1395473 Change-Id: I2c3cc350e0ac156616df6f568ba28dbfa68064bf updates: bz#789278 Signed-off-by: Ashish Pandey <aspandey@redhat.com>
* cluster/afr: Use 2 domain locking in SHD for thin-arbiterkarthik-us2018-09-205-91/+392
| | | | | | | | | | | | | | | | | | | | With this change when SHD starts the index crawl it requests all the clients to release the AFR_TA_DOM_NOTIFY lock so that clients will know the in memory state is no more valid and any new operations needs to query the thin-arbiter if required. When SHD completes healing all the files without any failure, it will again take the AFR_TA_DOM_NOTIFY lock and gets the xattrs on TA to see whether there are any new failures happened by that time. If there are new failures marked on TA, SHD will start the crawl immediately to heal those failures as well. If there are no new failures, then SHD will take the AFR_TA_DOM_MODIFY lock and unsets the xattrs on TA, so that both the data bricks will be considered as good there after. Change-Id: I037b89a0823648f314580ba0716d877bd5ddb1f1 fixes: bz#1579788 Signed-off-by: karthik-us <ksubrahm@redhat.com>
* glusterd: Use GF_ATOMIC to update 'blockers' counter at glusterd_confMohit Agrawal2018-09-204-12/+11
| | | | | | | | | | | | | | | Problem: Currently in glusterd code uses sync_lock/sync_unlock to update blockers counter which could add delays to the overall transaction phase escpecially when there's a batch of volume stop operations processed by glusterd in brick multiplexing mode. Solution: Use GF_ATOMIC to update blocker counter to ensure unnecessary context switching can be avoided. Change-Id: Ie13177dfee2af66687ae7cf5c67405c152853990 Fixes: bz#1631128 Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
* glusterd: fix crashSanju Rakonde2018-09-201-1/+1
| | | | | | | | | | | When huge number of volumes are created, glusterd crash is seen. With the core dump, got to know that mgmt_lock_timer became NULL. Adding a null check for the same, need to explore about the root cause. updates: bz#1630922 Change-Id: I0770063fcbbbf4b24bef29e94b857b20bdfb5b85 Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* geo-rep : fix coverity issues in glusterd-geo-rep.cSunny Kumar2018-09-201-7/+10
| | | | | | | | | | | | | | | | | This patch fixes CID 1210979, 1214614, 1292650, 1357874, 1382404. 1. overflowed or a truncated value : call to sys_read has been reduced to 'sizeof(buf) -1' and after operation buf is properly terminated. 2. tainted_data_argument : truncation due to cast operation on operand : resulted form call to strtol: chaged data type from pid_t to long. 3. tainted_data_argument : call to fgets is reduced by 2 to make space for the '\n' and '\0'. updates: bz#789278 Change-Id: Ib883501205c85007771213071c8e182286eb0bc0 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
* glusterd: Improve logging in gd_mgmt_v3_unlock_timer_cbkAtin Mukherjee2018-09-201-1/+4
| | | | | | Change-Id: I3335e7df3256d97c2211b64cfcaac9a016723471 Updates: bz#1193929 Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
* libglusterfs: NULL pointer dereferencing clang fixIraj Jamali2018-09-191-1/+1
| | | | | | | | | | | Problem: trav could be NULL. Solution: Adding a check to avoid clang error. Updates: bz#1622665 Change-Id: If26be82edea5e33c2356cea3769496f1cbd3774c Signed-off-by: Iraj Jamali <ijamali@redhat.com>
* cluster/afr: Batch writes in same lock even when multiple fds are openPranith Kumar K2018-09-191-9/+2
| | | | | | | | | | | | | | | | | | | | | | Problem: When eager-lock is disabled because of multiple-fds opened and app writes come on conflicting regions, the number of locks grows very fast leading to all the CPU being spent just in locking and unlocking by traversing huge queues in locks xlator for granting locks. Fix: Reduce the number of locks in transit by bundling the writes in the same lock and disable delayed piggy-pack when we learn that multiple fds are open on the file. This will reduce the size of queues in the locks xlator. This also reduces the number of network calls like inodelk/fxattrop. Please note that this problem can still happen if eager-lock is disabled as the writes will not be bundled in the same lock. fixes bz#1625961 Change-Id: I8fd1cf229aed54ce5abd4e6226351a039924dd91 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
* dht: utilize the framework to pass-through xlator tasksAmar Tumballi2018-09-1910-31/+234
| | | | | | | | | | | | | | | | | | | | | Also fixes the issue caused due to not converting back the fn function to after getting its address. We wanted the value of the field, not the address of the pt_fop field. With this patch, DHT will always be started in pass-through mode if the number of subvols is just 1. Fixes some tests to make sure DHT is in full config (ie, subvols > 1). - increased timeout of brick-mux test as it was bordering on 300 seconds. - Also change the volume type to supported 'replica 3' from 'replica 2'. - also no DHT tests should assume presence of DHT when there is just 1 brick in volume Credits: Nithya B <nbalacha@redhat.com> fixes: #405 Change-Id: I8e55239ce58d6ac6ae1901e2e384be1ecbd33d6e Signed-off-by: Amar Tumballi <amarts@redhat.com>
* extras/devel-tools: script to strace processesMilind Changire2018-09-191-0/+55
| | | | | | | | | | | | | | | | Script to strace processes at high priority. Script should be run at high priority, like nice value of -19, to help get a trace of a run-away process consuming high CPU. eg. $ nice -n -19 ./strace-brick.sh glusterfsd 50 will strace glusterfsd processes for 60 seconds which are consuming a minimum of 50% CPU. Change-Id: I6374054c7342b19122a3588d982388199f955930 BUG: 1427397 Signed-off-by: Milind Changire <mchangir@redhat.com>
* logrotate: utilize the new 'maxsize' optionAmar Tumballi2018-09-193-5/+35
| | | | | | | | | | | Since logrotate 3.8.x version, a new option 'maxsize' is supported, which helps in rotating the logs before the specified time if the size exceeds maxsize limit. This should help in reducing the overflow of gluster logs. Updates: bz#1193929 Change-Id: Id33c34d72f1931e7996893de9338db667e1e900d Signed-off-by: Amar Tumballi <amarts@redhat.com>
* extras/devel-tools: script to resolve backtracesMilind Changire2018-09-181-11/+16
| | | | | | | | | print-backtrace.sh script to resolve backtraces Change-Id: I24688ae5160cc706d9f4794521d17290bef6765b BUG: 1486532 Signed-off-by: Milind Changire <mchangir@redhat.com>
* tests/dht: Uncomment cleanup stepsN Balachandran2018-09-181-5/+5
| | | | | | | | | I had forgotten to uncomment the cleanup steps for file-create.t. Fixed. Change-Id: Id702b99b8e09f56b7333491a477828b4a37b2687 updates: bz#1628194 Signed-off-by: N Balachandran <nbalacha@redhat.com>
* tests: fixes to bug-1015990-rep.tRavishankar N2018-09-181-14/+7
| | | | | | | | | | | - check that the shd is connected to brick before running statistics command - remove sleep statements - remove unneeded ($count-$value==0) test when it is known that both values will be same Fixes: bz#1625850 Change-Id: Ifcd4887f0238031e5bca803cd9bfdb75a6e6c01b Signed-off-by: Ravishankar N <ravishankar@redhat.com>
* posix: Fix exporting default value for `export-statfs-size`Aravinda VK2018-09-181-1/+3
| | | | | | | | | | | | | No default value was specified for `export-statfs-size` in posix option table. Glusterd2 sets default value as `off` since the option type is `bool`. Posix treats `export-statfs-size=on` if not specified in volfile(That means default value is `on`) This patch sets default value as `on` Change-Id: I5c6341183be9b62a78fdbc94621220f9284e1382 updates: #302 Signed-off-by: Aravinda VK <avishwan@redhat.com>
* geo-rep: Fix issues related config setKotresh HR2018-09-186-11/+20
| | | | | | | | | | | | | | | | | | | | 1. '--ignore-mising-args' option for rsync is not being used even though the rsync version is greater than 3.1.0. Fixed the same. 2. '--existing' option for rsync is also not being used. Fixed the same. 3. geo-rep config fails to set rsync-options as the value contains '--'. Interestingly, python argsparse treats the value with '--' (e.g., --ignore-missing-args) as option. But when passed with something like --value=--ignore-missing-args, it succeeds. Fixed the same. Change-Id: Iaeb838acaff1c2920fee9c7f920c99edce13a0a1 Signed-off-by: Kotresh HR <khiremat@redhat.com> fixes: bz#1629561
* glusterd: acquire lock to update volinfo structureSanju Rakonde2018-09-183-34/+42
| | | | | | | | | | | | | | | | | | Problem: With commit cb0339f92, we are using a separate syntask for restart_bricks. There can be a situation where two threads are accessing the same volinfo structure at the same time and updating volinfo structure. This can lead volinfo to have inconsistent values and assertion failures because of unexpected values. Solution: While updating the volinfo structure, acquire a store_volinfo_lock, and release the lock only when the thread completed its critical section part. Fixes: bz#1627610 Signed-off-by: Sanju Rakonde <srakonde@redhat.com> Change-Id: I545e4e2368e3285d8f7aa28081ff4448abb72f5d
* event: get time by clock_gettime as pthread_cond_timedwait usingKinglong Mee2018-09-171-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Debug information shows time() has a delay between seconds increase, get the right time by clock_gettime as pthread_cond_timedwait using. ret = pthread_cond_timedwait (&event_pool->cond, &event_pool->mutex, &sleep_till); + gf_msg ("epoll", GF_LOG_INFO, 0, + LG_MSG_EXITED_EPOLL_THREAD, + "pthread_cond_timedwait %lu %p return %d (active %d:%d)", + sleep_till.tv_sec, event_pool, ret, + event_pool->activethreadcount, threadcount); } } pthread_mutex_unlock (&event_pool->mutex); [2018-09-06 18:33:57.000879] I [event.c:284:event_dispatch_destroy] 0-epoll: pthread_cond_timedwait 1536230037 0x1f48e60 return 110 (active 5:4) [2018-09-06 18:33:57.000916] I [event.c:284:event_dispatch_destroy] 0-epoll: pthread_cond_timedwait 1536230037 0x1f48e60 return 110 (active 5:4) [2018-09-06 18:33:57.000931] I [event.c:284:event_dispatch_destroy] 0-epoll: pthread_cond_timedwait 1536230037 0x1f48e60 return 110 (active 5:4) [2018-09-06 18:33:57.000945] I [event.c:284:event_dispatch_destroy] 0-epoll: pthread_cond_timedwait 1536230037 0x1f48e60 return 110 (active 5:4) [2018-09-06 18:33:57.000957] I [event.c:284:event_dispatch_destroy] 0-epoll: pthread_cond_timedwait 1536230037 0x1f48e60 return 110 (active 5:4) [2018-09-06 18:33:57.000970] I [event.c:284:event_dispatch_destroy] 0-epoll: pthread_cond_timedwait 1536230037 0x1f48e60 return 110 (active 5:4) [2018-09-06 18:33:57.000983] I [event.c:284:event_dispatch_destroy] 0-epoll: pthread_cond_timedwait 1536230037 0x1f48e60 return 110 (active 5:4) [2018-09-06 18:33:57.000997] I [event.c:284:event_dispatch_destroy] 0-epoll: pthread_cond_timedwait 1536230037 0x1f48e60 return 110 (active 5:4) [2018-09-06 18:33:57.001010] I [event.c:284:event_dispatch_destroy] 0-epoll: pthread_cond_timedwait 1536230037 0x1f48e60 return 110 (active 5:4) [2018-09-06 18:33:57.001022] I [event.c:284:event_dispatch_destroy] 0-epoll: pthread_cond_timedwait 1536230037 0x1f48e60 return 110 (active 5:4) [2018-09-06 18:33:57.001034] I [event.c:284:event_dispatch_destroy] 0-epoll: pthread_cond_timedwait 1536230037 0x1f48e60 return 110 (active 5:4) [2018-09-06 18:33:57.001060] I [event.c:284:event_dispatch_destroy] 0-epoll: pthread_cond_timedwait 1536230037 0x1f48e60 return 110 (active 5:4) [2018-09-06 18:33:57.003085] I [event.c:284:event_dispatch_destroy] 0-epoll: pthread_cond_timedwait 1536230038 0x1f48e60 return 0 (active 4:4) [2018-09-06 18:33:57.014142] I [event.c:284:event_dispatch_destroy] 0-epoll: pthread_cond_timedwait 1536230038 0x1f48e60 return 0 (active 3:4) Change-Id: I735249eee9a6f8284392b69e501479ac163b8409 fixes: bz#1626313 Signed-off-by: Kinglong Mee <mijinlong@open-fs.com>
* protocol/server: NULL pointer dereferencing clang fixShwetha K Acharya2018-09-172-4/+14
| | | | | | | | | | Problem: Access to field fop_length results in null pointer dereferencing. Solution: Added condition checks fix the issue. Change-Id: Id408e3ac62ea9574f0cd9aecce5434add09eb7d0 Updates: bz#1622665 Signed-off-by: Shwetha K Acharya <sacharya@redhat.com>
* glusterd: NULL pointer dereferencing clang FixHarpreet Lalwani2018-09-171-1/+1
| | | | | | | | | Added ternary operator to avoid NULL pointer dereferencing Updates: bz#1622665 Change-Id: I855f6caf720b28af1564898d75c6c965bcc58c5c Signed-off-by: Harpreet Lalwani <hlalwani@redhat.com>
* glusterd : fix coverity issue in glusterd-store.cSunny Kumar2018-09-171-1/+6
| | | | | | | | This patch fixes CID 1124356: Unchecked return value (CHECKED_RETURN) updates: bz#789278 Change-Id: I81f4637f19b81f820a2deb70cc7f84b79fe70236 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
* tests/dht: Add tests for file createN Balachandran2018-09-172-0/+159
| | | | | | | | Test dht file creates Change-Id: I7aba710f4911432bd3b86834efecae8f01e4052f updates: bz#1628194 Signed-off-by: N Balachandran <nbalacha@redhat.com>
* packaging: glusterfs.spec(.in) cleanupKaleb S. KEITHLEY2018-09-171-20/+20
| | | | | | | | | | | | | Someone (not me) once alphabetized all the %package, %files, and etc. sections, with a comment to keep them alphabetized. Move cloudsync sections to their correct locations in the spec. Also reorder testing and playground within %files section, keep testing %dirs together. Change-Id: I79e2e7a82d20275fd61d018880bcb5913c8f75f3 updates: bz#1193929 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
* gfapi: Cleanup alias fileShyamsundarR2018-09-173-7/+1
| | | | | | | | | 2 extra symbols were in the alias file, that are not exported this is cleaned up with this patch. Change-Id: I1ab54b9fb6b0d455884fbbfd89820c60bb861e6f Updates: bz#1193929 Signed-off-by: ShyamsundarR <srangana@redhat.com>
* libglusterfs/src/dict.c : use xxhash64 for hashing.Yaniv Kaul2018-09-171-13/+13
| | | | | | | | | | | | | | | | | | As part of a larger effort to consolidate hash functions and use a faster, with less collissions, I've moved to use xxhash as the hashing function for the dictionary. Note: I'm using only 32 bits of the hashes, as the hash field is currently a 32 bit variable. There's room (since the struct is not packed) to move to use a 64bit variable. Donno how it'll affect performance. Only compile-tested! updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com> Change-Id: Ie244efd1368234e54dd5957ee1ae5bebd7d9409a
* extras/hooks: General improvements to S30samba-start.shAnoop C S2018-09-141-13/+13
| | | | | | | | | Based on https://review.gluster.org/c/glusterfs/+/19204 from Milan Zink <mzink@redhat.com> Change-Id: I61f62407a62475a74a6cc046c24748a31c66e6cd Updates: bz#1193929 Signed-off-by: Anoop C S <anoopcs@redhat.com>
* socket: set 42 as default tpc-user-timeoutXavi Hernandez2018-09-141-3/+3
| | | | | | | | | | | | | | | | | The 'tcp-user-timeout' option is define in the 'socket' module, but it's configured in 'protocol/server' and 'protocol/client', which are the parents of the 'socket' module. However, current options management logic only takes into consideration default values specified in the 'socket' module itself, ignoring values defined in the owner xlator. This patch simply sets the default value of tcp-user-timeout in the 'socket' module so that server and client use the expected value. Change-Id: Ib8ad7c4ac6aac725b01a78f8c3d10cf4063d2ee6 fixes: bz#1628605 Signed-off-by: Xavi Hernandez <xhernandez@redhat.com>
* glusterd: Update op-version from 4.2 to 5.0ShyamsundarR2018-09-135-20/+22
| | | | | | | | | | | | Post changing the max op-version to 4.2, after release 4.1 branching, the decision was to go with increasing release numbers. Thus this needs to change to 5.0. This commit addresses the above change. Fixes: bz#1628664 Change-Id: Ifcc0c6da90fdd51e4eceea40749511110a432cce Signed-off-by: ShyamsundarR <srangana@redhat.com>
* build: cleanup xlator link, --no-undefined, libuuidv6devKaleb S. KEITHLEY2018-09-128-18/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While attempting to build a (pre-)5.0 of glusterfs on Ubuntu bionic and cosmic, it became apparent that there are some gremlins hiding in the combination of the xlator export-symbols, the newish addition of -Wl,--no-undefined, and the new switch to libuuid from the old contrib/uuid. Note: even though Fedora 28 (and later) and Ubuntu bionic (and later) have the same nominal version of libtool, the Fedora version appears to do a better job of recursing through dependencies to determine the libraries to link with. Examination of the build logs showed that despite appearing to work on Fedora, not all xlators and shared libs were linked with -Wl, --no-undefined, and -luuid. And in the case of the gnfs xlator, it was not only not linked with -Wl,--no-undefined but alsos not linked with -lgfxdr and -lgfrpc. Added GF_XLATOR_LDFLAGS, similar to GF_XLATOR_DEFAULT_LDFLAGS. GF_XLATOR_DEFAULT_LDFLAGS is for xlators that export/expose the default or common set of symbols. GF_XLATOR_LDFLAGS is for those remaining xlators that export/expose non-default symbols, e.g. dht and glupy. This removes the need in the future to add things like $(UUID_LIBS) to every xlator's Makefile.am. Just add it to GF_XLATOR_LDFLAGS and GF_XLATOR_DEFAULT_LDFLAGS in configure.ac and you're done. This patch was tested on Fedora 28 (build, rpmbuild), Fedora Rawhide/30 (rpmbuild), RHEL8 (rpmbuild), CentOS7 (rpmbuild), Fedora koji --scratch build for f30/rawhide, and a Launchpad build for Ubuntu cosmic/18.10. Change-Id: Ieca104fa5c5d3c094e701c8ca4a73754dd0292b0 updates: bz#1193929 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
* template files: revert clangAmar Tumballi2018-09-125-1169/+1260
| | | | | | Change-Id: If3925191d23afe83cbbdbc3cf0554c0a9c76d043 updates: bz#1564149 Signed-off-by: Amar Tumballi <amarts@redhat.com>
* Land part 2 of clang-format changesGluster Ant2018-09-12490-439790/+426792
| | | | | Change-Id: Ia84cc24c8924e6d22d02ac15f611c10e26db99b4 Signed-off-by: Nigel Babu <nigelb@redhat.com>
* Land clang-format changesGluster Ant2018-09-12364-31211/+29701
| | | | Change-Id: I6f5d8140a06f3c1b2d196849299f8d483028d33b
* clang-format: add the config fileAmar Tumballi2018-09-125-1/+151
| | | | | | | | Also update the required documents and scripts to enable clang-format Change-Id: I73aae6db06c2f732a1779d59a73bc05e28beafba updates: bz#1564149 Signed-off-by: Amar Tumballi <amarts@redhat.com>
* doc: make developer-index.md as READMEAmar Tumballi2018-09-121-0/+0
| | | | | | | | | | This helps to traverse the docs well as README.md is rendered by default in github pages, and would help to provide better indexed document for new users. updates: bz#1193929 Change-Id: I4130dfd16aed924ecab17f96326cedb86892d6a6 Signed-off-by: Amar Tumballi <amarts@redhat.com>
* dht: Use snprintf instead of strncpyN Balachandran2018-09-121-9/+20
| | | | | | | | | | | The recent changes to use malloc instead of calloc left the new_name and new_path non-null terminated. We now use snprintf instead of strncpy to fix this. Change-Id: I1a31701ca9447efde38921be0ba2c73cde2e7976 fixes: bz#1626346 Signed-off-by: N Balachandran <nbalacha@redhat.com>
* doc: add coding-standard and commit-msg link in READMEAmar Tumballi2018-09-111-0/+8
| | | | | | | | | Having the links in README makes people follow it if they browse through github. Updates: bz#1193929 Change-Id: I580332a41d9b52858aa9796a74a563ff57a60b4b Signed-off-by: Amar Tumballi <amarts@redhat.com>
* mount/fuse: convert ENOENT to ESTALE in open(dir)_resumeRaghavendra G2018-09-111-0/+9
| | | | | | | | | | | | | | | | | | | | | | This patch is continuation of commit fb4b914ce84bc83a5f418719c5ba7c25689a9251. <snip> mount/fuse: never fail open(dir) with ENOENT open(dir) being an operation on inode should never fail with ENOENT. If gfid is not present, the appropriate error is ESTALE. This will enable kernel to retry open after a revalidate lookup. </snip> Earlier commit failed to fix codepath where error response is sent back on gfid resolution failures in fuse_open(dir)_resume. Current patch completes that work Change-Id: Ia07e3cece404811703c8cfbac9b402ca5fe98c1e Signed-off-by: Raghavendra G <rgowdapp@redhat.com> updates: bz#1627620
* mgmt xlators: store boolean fields using integerYaniv Kaul2018-09-112-8/+11
| | | | | | | | | | | | | | | | | | | | Surprisingly, there is not set_boolean() as there is a get_boolean() In fact, it is stored as an INT dictionary type. In some occasions it was stored using a string, and this caused errors such as: key gfproxy-server, integer type asked, has string type [Invalid argument] I've fixed what I saw in some logs, I'm sure there are more. The CORRECT fix is to create a boolean set and use it, but this requires a bit more work. I'll see if I can do it later on. Only compile-tested! updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com> Change-Id: I45fd0c7a0824b2f42b8ce510296c9dfa4f32ad66
* glusterd: NULL pointer dereferencing clang fixHarpreet Lalwani2018-09-111-2/+1
| | | | | | | | | | | problem: NULL point dereferencing solution: Adding a conditional statement before and then dereferencing it. Updates: bz#1622665 Change-Id: I562ca90aebf2a4882cfea10114a90364d9ef1996 Signed-off-by: Harpreet Lalwani <hlalwani@redhat.com>
* misc: fix misc. shebangsKaleb S. KEITHLEY2018-09-118-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * One #!/usr/bin/env python and three #!/usr/bin/python were overlooked in all the other python fixups. Ugh. * Two new python files missed the memo about #!/usr/bin/python3. * One #!/usr/bin/env bash. Various distribution packaging policies have strong wording about the use of #!/usr/bin/env ... Note: this patch does not change the use of #!/usr/bin/env bash in the two files extras/{clang-checker.sh,check_goto.pl} as these are not included in any packages. (Although I'm not actually sure why anyone would ever use '/usr/bin/env {sh,bash}' as I'm not aware of any version-specific differences like there are with, e.g., python.) * One #!/usr/bin/bash. On Fedora and CentOS > 6, /bin is a symlink to /usr/bin, so it makes little difference. But Debian & Ubuntu still have separate /bin and /usr/bin; and sh and bash are in /bin, not /usr/bin. (Historically, in BSD and SYSV Unix it was /bin/sh.) Note: Fedora and CentOS package build runs a script that converts all /bin/sh and /bin/bash to /usr/bin/sh and /usr/bin/bash. Change-Id: I9171265829af78dd0cd7622c22b56d22179ff8a3 updates: bz#1193929 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
* rpm: add "--with asan" build optionNiels de Vos2018-09-112-1/+17
| | | | | | | | | | | | RHEL-6 does not have libasan, enabling the "--with asan" option is a no-op there. RHEL-7 has an earlier version of libasan, and that does not have the __asan_init symbol. Test for __asan_report_error in confiure.as instead. Change-Id: I6322e832c5cfbd7d750f5c32c84c28771674ced6 Updates: #492 Signed-off-by: Niels de Vos <ndevos@redhat.com>
* storage/posix: Fix coverity issue - Unchecked return valueAshish Pandey2018-09-111-1/+8
| | | | | | | | | | Fixes CID: 1388886 https://scan6.coverity.com/reports.htm#v42607/p10714/fileInstanceId=85287446&defectInstanceId=25997291&mergedDefectId=1388886 Change-Id: Ic4e558bba7e15d213c07bc31affb2e175ace5502 updates: bz#789278 Signed-off-by: Ashish Pandey <aspandey@redhat.com>
* performance/write-behind: remove the request from wip queue in ↵Raghavendra G2018-09-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | wb_fulfill_request The bug is very similar to bz 1379655 and the fix too very similar to commit a8b2a981881221925bb5edfe7bb65b25ad855c04. Before this patch, a request is removed from wip queue only when ref count of request hits 0. Though, wb_fulfill_request does an unref, it need not be the last unref and hence the request may survive in wip queue till the last unref. Let, T1: the time at which wb_fulfill_request is invoked T2: the time at which last unref is done on request Let's consider a case of T2 > T1. In the time window between T1 and T2, any other request (waiter) conflicting with request in liability queue (blocker - basically a write which has been lied) is blocked from winding. If T2 happens to be when wb_do_unwinds is invoked, no further processing of request list happens and "waiter" would get blocked forever. An example imaginary sequence of events is given below: 1. A write request w1 is picked up for winding in __wb_pick_winds and w1 is moved to wip queue. Let's call this invocation of wb_process_queue by wb_writev as PQ1. Note w1 is not unwound. 2. A dependent write (w2) hits write-behind and is unwound followed by a flush (f1) request. Since the liability queue of inode is not empty, w2 and f1 are not picked for unwinding. Let's call the invocation of wb_process_queue by wb_flush as PQ2. Note that invocation of wb_process_queue by w2 doesn't wind w2 instead unwinds it after which we hit PQ2 3. PQ2 continues and picks w1 for fulfilling and invokes wb_fulfill. As part of successful wb_fulfill_cbk, wb_fulfill_request (w1) is invoked. But, w1 is not freed (and hence not removed from wip queue) as w1 is not unwound _yet_ and a ref remains (PQ1 has not invoked wb_do_unwinds _yet_). 4. wb_fulfill_cbk (triggered by PQ2) invokes a wb_process_queue (let's say PQ3). w2 is not picked up for winding in PQ3 as w1 is still in wip queue. At this time, PQ2 and PQ3 are complete. 5. PQ1 continues, unwinds w1 and does last unref on w1 and w1 is freed (and removed from wip queue). Since PQ1 didn't invoke wb_fulfill on any other write requests, there won't be any future codepaths that would invoke wb_process_queue and w2 is stuck forever. This will prevent f2 too and hence close syscall is hung With this fix, w1 is removed from liability queue in step 3 above and PQ3 winds w2 in step 4 (as there are no requests conflicting with w2 in liability queue during execution of PQ3). Once w2 is complete, f1 is resumed. Change-Id: Ia972fad0858dc4abccdc1227cb4d880f85b3b89b Signed-off-by: Raghavendra G <rgowdapp@redhat.com> Fixes: bz#1626787