summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* afr : fix Coverity CID 1398627Rinku Kothiya2019-05-071-2/+9
| | | | | | | | | | | Fixed coverity error, "Unchecked return value (CHECKED_RETURN)". Checking return value & logging error message if afr_set_pending_dict fails. updates: bz#789278 Change-Id: Iab7da6b4f3cd0622b95b8e1c412b007a330467e5 Signed-off-by: Rinku Kothiya <rkothiya@redhat.com>
* libglusterfs: Fix compilation when --disable-mempool is usedPranith Kumar K2019-05-071-0/+5
| | | | | | updates bz#1193929 Change-Id: I245c065b209bcce5db939b6a0a934ba6fd393b47 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
* performance/write-behind: remove request from wip list in wb_writev_cbkRaghavendra G2019-05-061-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a race in the way O_DIRECT writes are handled. Assume two overlapping write requests w1 and w2. * w1 is issued and is in wb_inode->wip queue as the response is still pending from bricks. Also wb_request_unref in wb_do_winds is not yet invoked. list_for_each_entry_safe (req, tmp, tasks, winds) { list_del_init (&req->winds); if (req->op_ret == -1) { call_unwind_error_keep_stub (req->stub, req->op_ret, req->op_errno); } else { call_resume_keep_stub (req->stub); } wb_request_unref (req); } * w2 is issued and wb_process_queue is invoked. w2 is not picked up for winding as w1 is still in wb_inode->wip. w1 is added to todo list and wb_writev for w2 returns. * response to w1 is received and invokes wb_request_unref. Assume wb_request_unref in wb_do_winds (see point 1) is not invoked yet. Since there is one more refcount, wb_request_unref in wb_writev_cbk of w1 doesn't remove w1 from wip. * wb_process_queue is invoked as part of wb_writev_cbk of w1. But, it fails to wind w2 as w1 is still in wip. * wb_requet_unref is invoked on w1 as part of wb_do_winds. w1 is removed from all queues including w1. * After this point there is no invocation of wb_process_queue unless new request is issued from application causing w2 to be hung till the next request. This bug is similar to bz 1626780 and bz 1379655. Change-Id: Iaa47437613591699d4c8ad18bc0b32de6affcc31 Signed-off-by: Raghavendra G <rgowdapp@redhat.com> Fixes: bz#1705865
* mem-pool.{c|h}: minor changesYaniv Kaul2019-05-061-25/+12
| | | | | | | | | | | 1. Removed some code that was not needed. It did not really do anything. 2. CALLOC -> MALLOC in one place. Compile-tested only! updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com> Change-Id: I4419161e1bb636158e32b5d33044b06f1eef2449
* tests: delete the snapshots and the volume after the testsRaghavendra Bhat2019-05-061-0/+22
| | | | | | | | | | | | In uss.t multiple snapshots are taken and after all the tests things are left for the cleanup () function to get removed. Instead of that, delete the snapshots and the volume once all the tests are over so that cleanup operation becomes relatively a light operation. Change-Id: I2342740bbb185cd6c9a450eb3b4f5cbbba78974c fixes: bz#1704888 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>
* tests: validate volfile grammar - strings in volfileAmar Tumballi2019-05-065-85/+90
| | | | | | | | * libglusterfs/graph-print: remove unused code updates: bz#1693692 Change-Id: Iae81bb6a3af5911c3da07ab8f1d8f58f27e06905 Signed-off-by: Amar Tumballi <amarts@redhat.com>
* glusterd: coverity fixAtin Mukherjee2019-05-061-2/+14
| | | | | | | | CID: 1382403 (CHECKED_RETURN) Updates: bz#789278 Change-Id: I4c57b93fd3d14c524ff8519ed876f029834de306 Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
* cluster/ec: fix shd healer wait timeoutKinglong Mee2019-05-062-1/+2
| | | | | | | | | Right now, the timeout is written by hard code, fix it by using heal-timeout. fixes: bz#1703020 Change-Id: I0d154e7807f9dba7efc3896805559bbfaa7af2ad Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
* features/shard: Fix integer overflow in block count accountingKrutika Dhananjay2019-05-061-1/+1
| | | | | | | | ... by holding delta_blocks in 64-bit int as opposed to 32-bit int. Change-Id: I2c1ddab17457f45e27428575ad16fa678fd6c0eb updates: bz#1705884 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
* glusterd: prevent use-after-free in glusterd_op_ac_send_brick_op()Niels de Vos2019-05-061-2/+1
| | | | | | | | | Coverity reported that GF_FREE(req_ctx) could be called 2x on req_ctx. Change-Id: I9120686e5920de8c27688e10de0db6aa26292064 CID: 1401115 Updates: bz#789278 Signed-off-by: Niels de Vos <ndevos@redhat.com>
* cluster/ec: Reopen shouldn't happen with O_TRUNCPranith Kumar K2019-05-051-1/+1
| | | | | | | | | | | | | Problem: Doing re-open with O_TRUNC will truncate the fragment even when it is not needed needing extra heals Fix: At the time of re-open don't use O_TRUNC. fixes bz#1706603 Change-Id: Idc6408968efaad897b95a5a52481c66e843d3fb8 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
* glusterd-utils.c: reduce work in glusterd_add_volume_to_dict()Yaniv Kaul2019-05-031-58/+59
| | | | | | | | | | | 1. Use small arrays, 32 or 64 bytes should suffice. 2. Do not repeat the pattern of snprintf '%s.%d', prefix, count over and over. Change-Id: Ief6de78b766d9a07acb6256fc4830f4f3cfba7c9 updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
* glusterd: Fix coverity defects & put coverity annotationsAtin Mukherjee2019-05-0214-33/+65
| | | | | | | | | | | Along with fixing few defect, put the required annotations for the defects which are marked ignore/false positive/intentional as per the coverity defect sheet. This should avoid the per component graph showing many defects as open in the coverity glusterfs web page. Updates: bz#789278 Change-Id: I19461dc3603a3bd8f88866a1ab3db43d783af8e4 Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
* tests/cli: add .t file to increase line coverage in cliSanju Rakonde2019-05-021-0/+21
| | | | | | | updates: bz#1693692 Change-Id: Ib188c5fddea8c762e89ff15aa83b08c35cdb21e1 Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* tests: add .t files to increase cli code coveragerishubhjain2019-05-022-2/+3
| | | | | | | | different volume profile sub options are added in the test. Change-Id: I93100c37f51afc10870e60b91fcd86e7859e734a updates: bz#1693692 Signed-off-by: rishubhjain <rishubhjain47@gmail.com>
* tests: Add changelog snapshot testcaseKotresh HR2019-05-021-0/+60
| | | | | | | | | | Add testcase to test snapshot creation while I/O is happening with changelog enabled. updates: bz#1193929 Change-Id: Ice4cb596286c583ed7308484d65902007a48396c Signed-off-by: Kotresh HR <khiremat@redhat.com>
* glusterd: Fix bulkvoldict thread logic in brick multiplexingMohit Agrawal2019-04-301-6/+18
| | | | | | | | | | | | | | | Problem: Currently glusterd spawn bulkvoldict in brick_mux environment while no. of volumes are less than configured glusterd.vol_count_per_thread Solution: Correct the logic to spawn bulkvoldict thread 1) Calculate endindex only while total thread is non zero 2) Update end index correctly to pass index for bulkvoldict thread Fixes: bz#1704252 Change-Id: I1def847fbdd6a605e7687bfc4e42b706bf0eb70b Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
* cloudsync/plugin: coverity fixesSusant Palai2019-04-301-6/+6
| | | | | | | | | CID 1401087: Null pointer dereferences (REVERSE_INULL) CID 1401088: Null pointer dereferences (FORWARD_NULL) Change-Id: I71bf67af80e1b22bcd2eb997b01a1a5ef0b4d80b Updates: bz#789278 Signed-off-by: Susant Palai <spalai@redhat.com>
* options.c,h: minor changes to GF_OPTION_RECONFYaniv Kaul2019-04-302-49/+26
| | | | | | | | | | | Minor code changes (less variables and if statements) and use dict_get_strn(), since all options are fixed strings. Similar changes could be done to GF_OPTION_INIT() as well. Change-Id: I4a523f67183f4c4852a3d4de5e3cac52df68d3cf updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
* libglusterfs: remove compound-fop helper functionsAmar Tumballi2019-04-293-177/+3
| | | | | | updates: bz#1693692 Change-Id: If69702990af273be1f38855ba56b3b89fabff167 Signed-off-by: Amar Tumballi <amarts@redhat.com>
* storage/posix: fix fresh file detection delayXavier Hernandez2019-04-291-4/+20
| | | | | | | | | | | Current implementation made it possible to consider that a file was not fresh even if it was created less than a second ago. This patch fixes the way in which the delay is computed to ensure that at least one second has elapsed. Change-Id: I05f7b99e7e8dd97e31f7ebaaec6c39eecf98b00f Updates: bz#1193929 Signed-off-by: Xavier Hernandez <jahernan@redhat.com>
* nl-cache:add test to increase code coverageSheetal Pamecha2019-04-291-0/+30
| | | | | | Change-Id: Ie0a5c522dfa0123ca45f9decf5015d39b92cb0f3 updates: bz#1693692 Signed-off-by: Sheetal Pamecha <spamecha@redhat.com>
* protocol: remove compound fopAmar Tumballi2019-04-2911-7723/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | Compound fops are kept on wire as a backward compatibility with older AFR modules. The AFR module used beyond 4.x releases are not using compound fops. Hence removing the compound fop in the protocol code. Note that, compound-fops was already an 'option' in AFR, and completely removed since 4.1.x releases. So, point to note is, with this change, we have 2 ways to upgrade when clients of 3.x series are present. i) set 'use-compound-fops' option to 'false' on any volume which is of replica type. And then upgrade the servers. ii) Do a two step upgrade. First from current version (which will already be EOL if it's using compound) to a 4.1..6.x version, and then an upgrade to 7.x. Consider the overall code which we are removing for the option seems quite high, I believe it is worth it. updates: bz#1693692 Signed-off-by: Amar Tumballi <amarts@redhat.com> Change-Id: I0a8876d0367a15e1410ec845f251d5d3097ee593
* performance/decompounder: remove the translator as the feature is not used ↵Amar Tumballi2019-04-2912-1030/+4
| | | | | | | | anymore updates: bz#1693692 Change-Id: Id5932b11e115ca6da1c2bfff7ae1460787109e06 Signed-off-by: Amar Tumballi <amarts@redhat.com>
* glusterd: define dumpops in the xlator_api of glusterdSanju Rakonde2019-04-272-0/+14
| | | | | | | | | | | | | | Problem: statedump is not capturing information related to glusterd Solution: statdump is not capturing glusterd info because trav->dumpops is null in gf_proc_dump_single_xlator_info () where trav is glusterd xlator object. trav->dumpops is null because we missed to define dumpops in xlator_api of glusterd. defining dumpops in xlator_api of glusterd fixes the issue. fixes: bz#1703629 Change-Id: If85429ecb1ef580aced8d5b88d09fc15258bfc4c Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* cloudsync: Fix bug in cloudsync-fops-c.pyAnuradha Talur2019-04-261-3/+21
| | | | | | | | | | | | | | | | In some of the fops generated by generator.py, xdata request was not being wound to the child xlator correctly. This was happening because when though the logic in cloudsync-fops-c.py was correct, generator.py was generating a resultant code that omits this logic. Made changes in cloudsync-fops-c.py so that correct code is produced. Change-Id: I6f25bdb36ede06fd03be32c04087a75639d79150 updates: bz#1642168 Signed-off-by: Anuradha Talur <atalur@commvault.com>
* cloudsync/cvlt: Cloudsync plugin for commvault storeAnuradha Talur2019-04-2614-3/+1228
| | | | | | Change-Id: Icbe53e78e9c4f6699c7a26a806ef4b14b39f5019 updates: bz#1642168 Signed-off-by: Anuradha Talur <atalur@commvault.com>
* glusterd: coverity fixesAtin Mukherjee2019-04-265-8/+9
| | | | | | | | | | | | | | | | 1400775 - USE_AFTER_FREE 1400742 - Missing Unlock 1400736 - CHECKED_RETURN 1398470 - Missing Unlock Missing unlock is the tricky one, we have had annotation added, but coverity still continued to complaint. Added pthread_mutex_unlock to clean up the lock before destroying it to see if it makes coverity happy. Updates: bz#789278 Change-Id: I1d892612a17f805144d96c1b15004a85a1639414 Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
* glusterd: enable fips-mode-rchecksum for new volumesRavishankar N2019-04-261-0/+13
| | | | | | | | | | | | | ...during volume create if the cluster op-version is >=GD_OP_VERSION_7_0. This option itself was introduced in GD_OP_VERSION_4_0_0 via commit 6daa65356. We missed enabling it by default for new volume creates in that commit. If we are to do it now safely, we need to use op version GD_OP_VERSION_7_0 and target it for release-7. fixes: bz#1702303 Change-Id: I7c6d4a8abe0816367e7069cb5cad01744f04858f Signed-off-by: Ravishankar N <ravishankar@redhat.com>
* tools/glusterfind : validate session nameSaravanakumar Arumugam2019-04-261-8/+42
| | | | | | | | | | | | | Validate a session name(during create) for the following: 1. minimum 2 character length. 2. Maximum 256 characters. 3. No special characters apart from underscore, hyphen allowed. Also, validate volume(expect, while using glusterfind list). Change-Id: I1b1e64e218f93d0a531d3cf69fc2ce7e2ed11d01 BUG: 1241494 Signed-off-by: Saravanakumar Arumugam <sarumuga@redhat.com>
* geo-rep: Fix rename with existing destination with same gfidSunny Kumar2019-04-267-5/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Geo-rep fails to sync the rename properly if destination exists. It results in source to be remained on slave causing more number of files on slave. Also heavy rename workload like logrotate caused lot of ESTALE errors Cause: Geo-rep fails to sync rename if destination exists if creation of source file also falls into single batch of changelogs being processed. This is because, after fixing problematic gfids verifying from master, while re-processing original entries, CREATE also was re-processed causing more files on slave and rename to be failed. Solution: Entries need to be removed from retrial list after fixing problematic gfids on slave so that it's not re-created again on slave. Also treat ESTALE as EEXIST so that the error is properly handled verifying the op on master volume. Change-Id: I50cf289e06b997adddff0552bf2466d9201dd1f9 fixes: bz#1694820 Signed-off-by: Kotresh HR <khiremat@redhat.com> Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
* features/locks: error-out {inode,entry}lk fops with all-zero lk-ownerPranith Kumar K2019-04-265-15/+53
| | | | | | | | | | | | | | | | | Problem: Sometimes we find that developers forget to assign lk-owner for an inodelk/entrylk/lk before writing code to wind these 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. Fix: Disallow locks with lk-owner zero. fixes bz#1624701 Change-Id: I1aadcfbaaa4d49308f7c819505857e201809b3bc Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
* man/gluster: remove tier information from gluster manual pageSanju Rakonde2019-04-262-28/+1
| | | | | | fixes: bz#1702952 Change-Id: I650a3695d702c03dc60660ff197676c6d536a2ea Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* cloudsync: Make readdirp return stat info of all the direntsAnuradha Talur2019-04-253-1/+38
| | | | | | | | | | | | | | | This change got missed while the initial changes were sent. Should have been a part of : https://review.gluster.org/#/c/glusterfs/+/21757/ Gist of the change: Function that fills in stat info for dirents is invoked in readdirp in posix when cloudsync populates xdata request with GF_CS_OBJECT_STATUS. Change-Id: Ide0c4e80afb74cd2120f74ba934ed40123152d69 updates: bz#1642168 Signed-off-by: Anuradha Talur <atalur@commvault.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>
* glusterd: coverity fixesAtin Mukherjee2019-04-255-13/+50
| | | | | | | | | | | | | | | | | | | | | | | | Addresses the following: * CID 1124776: Resource leaks (RESOURCE_LEAK) - Variable "aa" going out of scope leaks the storage it points to in glusterd-volgen.c * Bunch of CHECKED_RETURN defects in the callers of synctask_barrier_init * CID 1400755: Error handling issues (CHECKED_RETURN) - Calling "gf_is_service_running" without checking return value in xlators/mgmt/glusterd/src/glusterd-shd-svc.c: 671 in glusterd_shdsvc_stop() * CID 1400745: Memory - illegal accesses (USE_AFTER_FREE) - Dereferencing freed pointer "volinfo" in /xlators/mgmt/glusterd/src/glusterd-shd-svc.c: 460 in glusterd_shdsvc_start() * CID 1400742: Program hangs (LOCK) - adding annotation to fix this false positive Updates: bz#789278 Change-Id: I02f16e7eeb8c5cf72f7d0b29d00df4f03b3718b3 Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
* features/bit-rot: Unconditionally sign the files during oneshot crawlRaghavendra Bhat2019-04-252-1/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently bit-rot feature has an issue with disabling and reenabling it on the same volume. Consider enabling bit-rot detection which goes on to crawl and sign all the files present in the volume. Then some files are modified and the bit-rot daemon goes on to sign the modified files with the correct signature. Now, disable bit-rot feature. While, signing and scrubbing are not happening, previous checksums of the files continue to exist as extended attributes. Now, if some files with checksum xattrs get modified, they are not signed with new signature as the feature is off. At this point, if the feature is enabled again, the bit rot daemon will go and sign those files which does not have any bit-rot specific xattrs (i.e. those files which were created after bit-rot was disabled). Whereas the files with bit-rot xattrs wont get signed with proper new checksum. At this point if scrubber runs, it finds the on disk checksum and the actual checksum of the file to be different (because the file got modified) and marks the file as corrupted. FIX: The fix is to unconditionally sign the files when the bit-rot daemon comes up (instead of skipping the files with bit-rot xattrs). Change-Id: Iadfb47dd39f7e2e77f22d549a4a07a385284f4f5 fixes: bz#1700078 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>
* build-aux/pkg-version: provide option for depth=1Amar Tumballi2019-04-251-3/+15
| | | | | | Change-Id: I385063b757ae71db70f22a2f7c94e6abeedff426 updates: bz#1701337 Signed-off-by: Amar Tumballi <amarts@redhat.com>
* logging.c/h: aggressively remove sprintfs()Yaniv Kaul2019-04-252-328/+201
| | | | | | | | | | | | | | | | | | | | | | Try to reduce the number of sprintf() and string copies until we finally log a log line. Specifically, do not sprintf separately the timestr string and do not sprintf/strcpy the appmsgstr separately - just stick it with the header. Hoping I did not leak anything or changed the log line formatting. Also, allocate 4K (GF_LOG_BACKTRACE_SIZE) of memory dynamically for trace output - only if trace was actually requested (previously, it was unconditionally) In addition, some minor code formatting (unrelated to the above). updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com> Change-Id: Id2ccc85f9213a2b1c6eaa4a2f58ce043eac1824f
* cluster/dht: Refactor dht lookup functionsN Balachandran2019-04-251-74/+30
| | | | | | | | | | Part 2: Modify dht_revalidate_cbk to call dht_selfheal_directory instead of separate calls to heal attrs and xattrs. Change-Id: Id41ac6c4220c2c35484812bbfc6157fc3c86b142 updates: bz#1590385 Signed-off-by: N Balachandran <nbalacha@redhat.com>
* geo-rep: Fix entries and metadata counters in geo-rep statusKotresh HR2019-04-241-3/+2
| | | | | | | | | | Entries counter was incremented twice and decremented only once. And entries count was being used in place of metadata entries. This patch fixes both of them. fixes: bz#1512093 Change-Id: I5601a5fe8d25c9d65b72eb529171e7117ebbb67f Signed-off-by: Kotresh HR <khiremat@redhat.com>
* tests/geo-rep: Add pause and resume test case for geo-repShwetha K Acharya2019-04-242-0/+12
| | | | | | | | Added pause and resume test case for geo-rep fixes: bz#1696077 Change-Id: Ib6fcc1926c3be1263bca1235194f737b895c8333 Signed-off-by: Shwetha K Acharya <sacharya@redhat.com>
* tests: add .t files to increase cli code coveragerishubhjain2019-04-241-0/+62
| | | | | | | | | Tests added for gluster volume top and profile with and without xml output Change-Id: I66aa6390b53ca448014059a3d27dc72e405216d2 updates: bz#1693692 Signed-off-by: rishubhjain <rishubhjain47@gmail.com>
* tests: add .t file to increase cli code coverageSanju Rakonde2019-04-243-1/+97
| | | | | | | updates: bz#1693692 Change-Id: I848e622d7b8562e864f0e208aafdc21d9cb757d3 Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* ctime: Fix log repeated logging during openKotresh HR2019-04-241-10/+5
| | | | | | | | | | | | The log "posix set mdata failed, No ctime" logged repeatedly after the fix [1]. Those could be internal fops. This patch fixes the same. [1] https://review.gluster.org/22540 fixes: bz#1701457 Change-Id: I42799a90b976982cedb0ca11fa224d555eb05650 Signed-off-by: Kotresh HR <khiremat@redhat.com>
* core: avoid dynamic TLS allocation when possibleXavi Hernandez2019-04-2412-492/+114
| | | | | | | | | | | | | | | | | | | 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/shd: Keep a ref on volinfo until attach rpc execute cbkMohammed Rafi KC2019-04-242-0/+7
| | | | | | | | | | | When svc attach execute for multiplexing a daemon, we have to keep a ref on volinfo until it finish the execution. Because, if the attach is an aysnc call, then a parallel volume delete can lead to free the volinfo Change-Id: Ibc02b89557baaed2f63db63d7fb1a7480444ae0d fixes: bz#1702185 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
* build: conditional rpcbind for gnfs in glusterd.serviceKaleb S. KEITHLEY2019-04-233-2/+6
| | | | | | | | | | | | Don't Require: rpcbind in glusterd.service when gnfs isn't built Also add .../gluster-ta-volume.service to .gitignore See https://github.com/gluster/glusterfs/issues/647 Change-Id: I4d90cf66b12c378c0a9aace89a3a4bbf3784c284 Fixes: #647 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
* cluster/ec: fix fd reopenXavi Hernandez2019-04-2316-285/+377
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently EC tries to reopen fd's that have been opened while a brick was down. This is done as part of regular write operations, just after having acquired the locks, and it's sent as a sub-fop of the main write fop. There were two problems: 1. The reopen was attempted on all UP bricks, even if a previous lock didn't succeed. This is incorrect because most probably the open will fail. 2. If reopen is sent and fails, the error is propagated to the main operation, causing it to fail when it shouldn't. To fix this, we only attempt reopens on bricks where the current fop owns a lock, and we prevent any error to be propagated to the main fop. To implement this behaviour an argument used to indicate the minimum number of required answers has overloaded to also include some flags. To make the change consistent, it has been necessary to rename the argument, which means that a lot of files have been changed. However there are no functional changes. This change has also uncovered a problem in discard code, which didn't correctely process requests of small sizes because no real discard fop was being processed, only a write of 0's on some region. In this case some fields of the fop remained uninitialized or with incorrect values. To fix this, a new function has been created to simulate success on a fop and it's used in the discard case. Thanks to Pranith for providing a test script that has also detected an issue in this patch. This patch includes a small modification of this script to force data to be written into bricks before stopping them. Change-Id: If272343873369186c2fb8f43c1d9c52c3ea304ec Fixes: bz#1699866 Signed-off-by: Xavi Hernandez <xhernandez@redhat.com>
* core: fix hang issue in __gf_freeSusant Palai2019-04-221-1/+0
| | | | | | | | | | | | | | | Currently GF_ASSERT is done under mem_accounting lock at some places. On a GF_ASSERT failure, gf_msg_callingfn is called which calls gf_malloc internally and it takes the same mem_accounting lock leading to deadlock. This is a temporary fix to avoid any hang issue in master. https://review.gluster.org/#/c/glusterfs/+/22589/ is being worked on in the mean while so that GF_ASSERT can be used under mem_accounting lock. Change-Id: I6d67f23979e7edd2695bdc6aab2997dae4a4060a updates: bz#1700865 Signed-off-by: Susant Palai <spalai@redhat.com>