summaryrefslogtreecommitdiffstats
path: root/xlators/cluster
Commit message (Collapse)AuthorAgeFilesLines
* cluster/dht: make rebalance use truncate incaseSusant Palai2017-11-223-71/+99
| | | | | | | | | .. the brick file system does not support fallocate. Change-Id: Id76cda2d8bb3b223b779e5e7a34f17c8bfa6283c BUG: 1488103 Signed-off-by: Susant Palai <spalai@redhat.com>
* ec: Use tiebreaker_inodelk where necessaryPranith Kumar K2017-11-221-8/+11
| | | | | | | | | | | | | | | | | When there are big directories or files that need to be healed, other shds are stuck on getting lock on self-heal domain for these directories/files. If there is a tie-breaker logic, other shds can heal some other files/directories while 1 of the shds is healing the big file/directory. Before this patch: 96.67 4890.64 us 12.89 us 646115887.30us 340869 INODELK After this patch: 40.76 42.35 us 15.09 us 6546.50us 438478 INODELK Fixes gluster/glusterfs#354 Change-Id: Ia995b5576b44f770c064090705c78459e543cc64 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
* cluster/dht: Coverity fixes for dht-rebalance.ckarthik-us2017-11-211-80/+54
| | | | | | | | | | | | | | | | | | Warning Functions DEADCODE gf_defrag_handle_migrate_error gf_defrag_get_entry gf_defrag_process_dir gf_defrag_start_crawl dht_migrate_file UNUSED_VALUE migrate_special_files dht_migrate_file FORWARD_NULL gf_tier_do_fix_layout Change-Id: I6f408585b83a267581a4273dae7c22b8993163d5 BUG: 789278 Signed-off-by: karthik-us <ksubrahm@redhat.com>
* cluster/dht: dead code coverity fixKartik_Burmee2017-11-211-3/+0
| | | | | | | | | | | | issue: Execution cannot reach this statement: "call_stub_destroy(stub);" function: dht_mkdir_hashed_cbk fix: removed the statement and the corresponding 'if' condition block. Change-Id: I3e31056ee489ede6864e51a8e666edc7da3c175f BUG: 789278 Signed-off-by: Kartik_Burmee <kburmee@redhat.com>
* cluster/dht: Don't set ACLs on linkto fileN Balachandran2017-11-191-0/+11
| | | | | | | | | | | | | | The trusted.SGI_ACL_FILE appears to set posix ACLs on the linkto file that is a target of file migration. This can mess up file permissions and cause linkto identification to fail. Now we remove all ACL xattrs from the results of the listxattr call on the source before setting them on the target. Change-Id: I56802dbaed783a16e3fb90f59f4ce849f8a4a9b4 BUG: 1514329 Signed-off-by: N Balachandran <nbalacha@redhat.com>
* afr: add checks for allowing lookupsRavishankar N2017-11-184-93/+162
| | | | | | | | | | | | | | | | | | | | | | Problem: In an arbiter volume, lookup was being served from one of the sink bricks (source brick was down). shard uses the iatt values from lookup cbk to calculate the size and block count, which in this case were incorrect values. shard_local_t->last_block was thus initialised to -1, resulting in an infinite while loop in shard_common_resolve_shards(). Fix: Use client quorum logic to allow or fail the lookups from afr if there are no readable subvolumes. So in replica-3 or arbiter vols, if there is no good copy or if quorum is not met, fail lookup with ENOTCONN. With this fix, we are also removing support for quorum-reads xlator option. So if quorum is not met, neither read nor write txns are allowed and we fail the fop with ENOTCONN. Change-Id: Ic65c00c24f77ece007328b421494eee62a505fa0 BUG: 1467250 Signed-off-by: Ravishankar N <ravishankar@redhat.com>
* cluster/afr: Fix for arbiter becoming sourcekarthik-us2017-11-184-6/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: When eager-lock is on, and two writes happen in parallel on a FD we were observing the following behaviour: - First write fails on one data brick - Since the post-op is not yet happened, the inode refresh will get both the data bricks as readable and set it in the inode context - In flight split brain check see both the data bricks as readable and allows the second write - Second write fails on the other data brick - Now the post-op happens and marks both the data bricks as bad and arbiter will become source for healing Fix: Adding one more variable called write_suvol in inode context and it will have the in memory representation of the writable subvols. Inode refresh will not update this value and its lifetime is pre-op through unlock in the afr transaction. Initially the pre-op will set this value same as read_subvol in inode context and then in the in flight split brain check we will use this value instead of read_subvol. After all the checks we will update the value of this and set the read_subvol same as this to avoid having incorrect value in that. Change-Id: I2ef6904524ab91af861d59690974bbc529ab1af3 BUG: 1482064 Signed-off-by: karthik-us <ksubrahm@redhat.com>
* tier: coverity fix for tier-common.chari gowtham2017-11-161-28/+5
| | | | | | | | | fix for the coverity id: 258, 162 Change-Id: I35ba21e37e186b7c1ce54faf5b24f48858e6fc70 BUG: 789278 Signed-off-by: hari gowtham <hgowtham@redhat.com>
* cluster/ec: Fix op-version for disperse.other-eager-lockXavier Hernandez2017-11-141-1/+1
| | | | | | | | | The op-version used for the new option was wrong. It has been set to 3.13.0. Change-Id: I88fbd7834e4a8018c8906303e734c251e90be8cf BUG: 1502610 Signed-off-by: Xavier Hernandez <jahernan@redhat.com>
* cluster: dead_code coverity fixKartik_Burmee2017-11-141-2/+0
| | | | | | | | | | | | function: stripe_entry_self_heal issue: Execution cannot reach this statement: "dict_unref(xdata);" fix: removed the 'if' condition and the corresponding actions because if the execution reaches this statement, then the value of xdata will always be NULL Change-Id: Iebc825339e2e1236b92bed39d81a1a9aba10164e BUG: 789278 Signed-off-by: Kartik_Burmee <kburmee@redhat.com>
* cluster/ec: Keep last written strip in in-memory cacheAshish Pandey2017-11-108-84/+519
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Consider an EC volume with configuration 4 + 2. The stripe size for this would be 512 * 4 = 2048. That means, 2048 bytes of user data stored in one stripe. Let's say 2048 + 512 = 2560 bytes are already written on this volume. 512 Bytes would be in second stripe. Now, if there are sequential writes with offset 2560 and of size 1 Byte, we have to read the whole stripe, encode it with 1 Byte and then again have to write it back. Next, write with offset 2561 and size of 1 Byte will again READ-MODIFY-WRITE the whole stripe. This is causing bad performance because of lots of READ request travelling over the network. There are some tools and scenario's where such kind of load is coming and users are not aware of that. Example: fio and zip Solution: One possible solution to deal with this issue is to keep last stripe in memory. This way, we need not to read it again and we can save READ fop going over the network. Considering the above example, we have to keep last 2048 bytes (maximum) in memory per file. Change-Id: I3f95e6fc3ff81953646d374c445a40c6886b0b85 BUG: 1471753 Signed-off-by: Ashish Pandey <aspandey@redhat.com>
* Coverity Issue: PW.INCLUDE_RECURSION in several filesGirjesh Rajoria2017-11-096-10/+0
| | | | | | | | | | | | | | Coverity ID: 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 423, 424, 425, 426, 427, 428, 429, 436, 437, 438, 439, 440, 441, 442, 443 Issue: Event include_recursion Removed redundant, recursive includes from the files. Change-Id: I920776b1fa089a2d4917ca722d0075a9239911a7 BUG: 789278 Signed-off-by: Girjesh Rajoria <grajoria@redhat.com>
* cluster/ec: UNUSED_VALUE coverity fixSunil Kumar Acharya2017-11-081-0/+4
| | | | | | | | | | Problem: Return values are not used. Solution: Removed the unused values. BUG: 789278 Change-Id: Ica2b95bb659dfc7ec5346de0996b9d2fcd340f8d Signed-off-by: Sunil Kumar Acharya <sheggodu@redhat.com>
* cluster/ec: REVERSE_INULL coverity fixSunil Kumar Acharya2017-11-081-2/+1
| | | | | | | | | | Problem: fop could be NULL. Solution: Check has been added to verify fop. BUG: 789278 Change-Id: I7e8d2c1bdd8960c609aa485f180688a95606ebf7 Signed-off-by: Sunil Kumar Acharya <sheggodu@redhat.com>
* cluster/dht: Check for NULL local before using itAshish Pandey2017-11-081-2/+6
| | | | | | | | | | | Coverity ID: 261 Coverity ID: 257 Check if local is NULL or not Change-Id: I570f87f32e1347f891c6a02ee5641fcc5a262a96 BUG: 789278 Signed-off-by: Ashish Pandey <aspandey@redhat.com>
* cluster/ec: NEGATIVE_RETURNS coverity fixSunil Kumar Acharya2017-11-071-0/+5
| | | | | | | | | | Problem: Source could be negative. Solution: Check has been added to verify the same. BUG: 789278 Change-Id: I8cca6297327e7923b25949c20ec8d1a711207a76 Signed-off-by: Sunil Kumar Acharya <sheggodu@redhat.com>
* cluster/ec: FORWARD_NULL coverity fixSunil Kumar Acharya2017-11-071-4/+6
| | | | | | | | | | Problem: xattr could be NULL. Solution: Added check to verify the same. BUG: 789278 Change-Id: Ie013f5655f4621434e5023dd76cef44b976adc68 Signed-off-by: Sunil Kumar Acharya <sheggodu@redhat.com>
* cluster/dht: Check for NULL before using variableAshish Pandey2017-11-062-4/+6
| | | | | | | | | | | | Coverity ID: 245 Check statvfs received as cbk before using it Coverity ID: 228 Check NULL loc before freeing it. Change-Id: I1b153ed5e7b81bcf7033bf710808e95908dcfef4 BUG: 789278 Signed-off-by: Ashish Pandey <aspandey@redhat.com>
* cluster/ec: Remove possibility of NULL derefAshish Pandey2017-11-051-1/+1
| | | | | | | | | | | | | Coverity ID: 237 Problem: In ec_check_status we are trying to deref fop->answer which could be NULL. Solution: Check Null condition before using this pointer. Change-Id: I4f9a73dc2f062ca9c62b4c4baf0a6fcadade88f2 BUG: 789278 Signed-off-by: Ashish Pandey <aspandey@redhat.com>
* cluster/ec: create eager-lock option for non-regular filesXavier Hernandez2017-11-053-13/+47
| | | | | | | | | A new option is added to allow independent configuration of eager locking for regular files and non-regular files. Change-Id: I8f80e46d36d8551011132b15c0fac549b7fb1c60 BUG: 1502610 Signed-off-by: Xavier Hernandez <jahernan@redhat.com>
* core: make gf_boolean_t a C99 bool instead of an enumJeff Darcy2017-11-032-4/+10
| | | | | | | | | | | | This reduces the space used from four bytes to one, and allows new code to use familiar C99 types/values interoperably with our old cruft. It does *not* change current declarations or code; that will be left for a separate - much larger - patch. Updates: #80 Change-Id: I5baedd17d3fb05b38f0d8b8bb9dd62824475842e Signed-off-by: Jeff Darcy <jdarcy@fb.com>
* xlator/tier: flood of -Wformat-truncation warnings with gcc-7.1v4.0dev1Kaleb S. KEITHLEY2017-11-011-8/+9
| | | | | | | | | | | | | | | | Starting in Fedora 26 which has gcc-7.1.x, -Wformat-trunction is enabled with -Wformat, resulting in a flood of new warnings. This many warnings is a concern because it makes it hard(er) to see other warnings that should be addressed. An example is at https://kojipkgs.fedoraproject.org//packages/glusterfs/3.12.0/1.fc28/data/logs/x86_64/build.log For more info see https://review.gluster.org/#/c/18267/ Change-Id: Id7ef8e0dedd28ada55f72c03d91facbe1c9888bd BUG: 1492849 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
* cluster/ec: FORWARD_NULL coverity fixSunil Kumar Acharya2017-11-011-1/+3
| | | | | | | | | | Problem: frame could be NULL. Solution: Added check to verify frame. BUG: 789278 Change-Id: I55a64c936ae71ec8587a3f9dfa0fdee5d0ea5213 Signed-off-by: Sunil Kumar Acharya <sheggodu@redhat.com>
* cluster/ec: FORWARD_NULL coverity fixSunil Kumar Acharya2017-11-012-0/+5
| | | | | | | | | | Problem: cbk could be NULL. Solution: Assigned appropriate value to cbk. BUG: 789278 Change-Id: I2e4bba9a54f965c6a7bccf0b0cb6c5f75399f6e6 Signed-off-by: Sunil Kumar Acharya <sheggodu@redhat.com>
* cluster/ec: MISSING_BREAK coverity fixSunil Kumar Acharya2017-10-311-0/+3
| | | | | | | | | | Problem: switch case syntax issue. Solution: syntax fixed. BUG: 789278 Change-Id: I76da72c3ab6ffc5db671686a71d6a596beaf496e Signed-off-by: Sunil Kumar Acharya <sheggodu@redhat.com>
* cluster/afr: Honor default timeout of 5min for analyzing split-brain fileskarthik-us2017-10-301-1/+5
| | | | | | | | | | | | | | | | | | | Problem: After setting split-brain-choice option to analyze the file to resolve the split brain using the command "setfattr -n replica.split-brain-choice -v "choiceX" <path-to-file>" should allow to access the file from mount for default timeout of 5mins. But the timeout was not honored and was able to access the file even after the timeout. Fix: Call the inode_invalidate() in afr_set_split_brain_choice_cbk() so that it will triger the cache invalidate after resetting the timer and the split brain choice. So the next calls to access the file will fail with EIO. Change-Id: I698cb833676b22ff3e4c6daf8b883a0958f51a64 BUG: 1503519 Signed-off-by: karthik-us <ksubrahm@redhat.com>
* cluster/afr: Fail open on split-brainPranith Kumar K2017-10-2611-95/+208
| | | | | | | | | | | | | | | | | Problem: Append on a file with split-brain succeeds. Open is intercepted by open-behind, when write comes on the file, open-behind does open+write. Open succeeds because afr doesn't fail it. Then write succeeds because write-behind intercepts it. Flush is also intercepted by write-behind, so the application never gets to know that the write failed. Fix: Fail open on split-brain, so that when open-behind does open+write open fails which leads to write failure. Application will know about this failure. Change-Id: I4bff1c747c97bb2925d6987f4ced5f1ce75dbc15 BUG: 1294051 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
* cluster/ec: Implement DISCARD FOP for ECSunil Kumar Acharya2017-10-255-48/+332
| | | | | | | | | | | Updates #254 This code change implements DISCARD FOP support for EC. BUG: 1461018 Change-Id: I09a9cb2aa9d91ec27add4f422dc9074af5b8b2db Signed-off-by: Sunil Kumar Acharya <sheggodu@redhat.com>
* cluster/ec: Allow parallel writes in EC if possiblePranith Kumar K2017-10-248-142/+282
| | | | | | | | | | | | | | | | | | Problem: Ec at the moment sends one modification fop after another, so if some of the disks become slow, for a while then the wait time for the writes that are waiting in the queue becomes really bad. Fix: Allow parallel writes when possible. For this we need to make 3 changes. 1) Each fop now has range parameters they will be updating. 2) Xattrop is changed to handle parallel xattrop requests where some would be modifying just dirty xattr. 3) Fops that refer to size now take locks and update the locks. Fixes #251 Change-Id: Ibc3c15372f91bbd6fb617f0d99399b3149fa64b2 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
* cluster/dht: fix crash when deleting directoriesZhang Huan2017-10-161-2/+4
| | | | | | | | | | | | | | | | | | | | | In DHT, after locks on all subvolumes are acquired, it would perform the following steps sequentially, 1. send remove dir on all other subvolumes except the hashed one in a loop; 2. wait for all pending rmdir to be done 3. remove dir on the hashed subvolume The problem is that in step 1 there is a check to skip hashed subvolume in the loop. If the last subvolume to check is actually the hashed one, and step 3 is quickly done before the last and hashed subvolume is checked, by accessing shared context data be destroyed in step 3, would cause a crash. Fix by saving shared data in a local variable to access later in the loop. Change-Id: I8db7cf7cb262d74efcb58eb00f02ea37df4be4e2 BUG: 1490642 Signed-off-by: Zhang Huan <zhanghuan@open-fs.com>
* cluster/ec: Coverity Fix UNUSED_VALUE in ec_create_nameKamal Mohanan2017-10-161-1/+1
| | | | | | | | | | | | | Problem: The value returned by cluster_mkdir is assigned to ret at ec-heal.c:1076. But this value is overwritten before it can be used. Solution: The return value of cluster_mkdir is ignored. It is not assigned to ret. Change-Id: Iee6b8d8b04e0bd800dd30d2c24cab755b9e63443 BUG: 789278 Signed-off-by: Kamal Mohanan <kmohanan@redhat.com>
* cluster/ec: Improve heal info command to handle obvious casesAshish Pandey2017-10-163-24/+41
| | | | | | | | | | | | | | | | | | | | | | | | | Problem: 1 - If a brick is down and we see an index entry in .glusterfs/indices, we should show it in heal info output as it most certainly needs heal. 2 - The first problem is also not getting handled after ec_heal_inspect. Even if in ec_heal_inspect, lookup will mark need_heal as true, we don't handle it properly in ec_get_heal_info and continue with locked inspect which takes lot of time. Solution: 1 - In first case we need not to do any further invstigation. As soon as we see that a brick is down, we should say that this index entry needs heal for sure. 2 - In second case, if we have need_heal as _gf_true after ec_heal_inspect, we should show it as heal requires. Change-Id: Ibe7f9d7602cc0b382ba53bddaf75a2a2c3326aa6 BUG: 1476668 Signed-off-by: Ashish Pandey <aspandey@redhat.com>
* cluster/ec: add functions for stripe alignmentXavier Hernandez2017-10-136-47/+129
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes old functions to align offsets and sizes to stripe size boundaries and adds new ones to offer more possibilities. The new functions are: * ec_adjust_offset_down() Aligns a given offset to a multiple of the stripe size equal or smaller than the initial one. It returns the size of the gap between the aligned offset and the given one. * ec_adjust_offset_up() Aligns a given offset to a multiple of the stripe size equal or greater than the initial one. It returns the size of the skipped region between the given offset and the aligned one. If an overflow happens, the returned valid has negative sign (but correct value) and the offset is set to the maximum value (not aligned). * ec_adjust_size_down() Aligns the given size to a multiple of the stripe size equal or smaller than the initial one. It returns the size of the missed region between the aligned size and the given one. * ec_adjust_size_up() Aligns the given size to a multiple of the stripe size equal or greater than the initial one. It returns the size of the gap between the given size and the aligned one. If an overflow happens, the returned value has negative sign (but correct value) and the size is set to the maximum value (not aligned). These functions have been defined in ec-helpers.h as static inline since they are very small and compilers can optimize them (specially the 'scale' argument). Change-Id: I4c91009ad02f76c73772034dfde27ee1c78a80d7 Signed-off-by: Xavier Hernandez <jahernan@redhat.com>
* dht: free memory allocated in dht_init() and dht_init_subvolumes()Niels de Vos2017-10-111-1/+17
| | | | | | | | | When glfs_fini() is called, DHT fails to free all memory allocations which result in a considerable leak. Change-Id: I37c6de5c93ca4516266dbe8288b4a416f5589901 BUG: 1443145 Signed-off-by: Niels de Vos <ndevos@redhat.com>
* cluster/dht: Don't store the entire uuid for subvolsN Balachandran2017-10-104-19/+40
| | | | | | | | | | | | Comparing the uuid string of the local node against that stored in the local_subvol information is inefficient, especially as it is done for every file to be migrated. The code has now been changed to set the value of info to 1 if the nodeuuid is that of the node making the comparison so this becomes an integer comparison. Change-Id: I7491d59caad3b71dbf5facc94dcde0cd53962775 BUG: 1451434 Signed-off-by: N Balachandran <nbalacha@redhat.com>
* cluster/ec: Handle parallel get_size_versionPranith Kumar K2017-10-103-59/+102
| | | | | | Updates #251 Change-Id: I6244014dbc90af3239d63d75a064ae22ec12a054 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
* afr: heal gfid as a part of entry healRavishankar N2017-10-094-67/+120
| | | | | | | | | | | | | | | | | | Problem: If a brick crashes after an entry (file or dir) is created but before gfid is assigned, the good bricks will have pending entry heal xattrs but the heal won't complete because afr_selfheal_recreate_entry() tries to create the entry again and it fails with EEXIST. Fix: We could have fixed posx_mknod/mkdir etc to assign the gfid if the file already exists but the right thing to do seems to be to trigger a lookup on the bad brick and let it heal the gfid instead of winding an mknod/mkdir in the first place. Change-Id: I82f76665a7541f1893ef8d847b78af6466aff1ff BUG: 1493415 Signed-off-by: Ravishankar N <ravishankar@redhat.com>
* cluster/ec: Improve performance with xattrop updateSunil Kumar Acharya2017-10-061-24/+102
| | | | | | | | | | | | Existing EC code updates the xattr on the subvolume in a sequential pattern resulting in very poor performance. With this fix EC now updates the xattr on the subvolume in parallel which improves the xattr update performance. BUG: 1445663 Change-Id: I3fc40d66db0b88875ca96a9fa01002ba386c0486 Signed-off-by: Sunil Kumar Acharya <sheggodu@redhat.com>
* xlator/cluster/afr:coverity Issue "UNUSED_VALUE" in afr_get_split_brain_statusSubha sree Mohankumar2017-10-051-1/+7
| | | | | | | | | | | Issue: Event value_overwrite:Overwriting previous write to "ret" with value "-1". Fix : An "If" condition is added to check the value of "ret". Change-Id: I7b6bd4f20f73fa85eb8a5169644e275c7b56af51 BUG: 789278 Signed-off-by: Subha sree Mohankumar <smohanku@redhat.com>
* cluster/dht : User xattrs are not healed after brick stop/startMohit Agrawal2017-10-047-111/+2077
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: In a distributed volume custom extended attribute value for a directory does not display correct value after stop/start or added newly brick. If any extended(acl) attribute value is set for a directory after stop/added the brick the attribute(user|acl|quota) value is not updated on brick after start the brick. Solution: First store hashed subvol or subvol(has internal xattr) on inode ctx and consider it as a MDS subvol.At the time of update custom xattr (user,quota,acl, selinux) on directory first check the mds from inode ctx, if mds is not present on inode ctx then throw EINVAL error to application otherwise set xattr on MDS subvol with internal xattr value of -1 and then try to update the attribute on other non MDS volumes also.If mds subvol is down in that case throw an error "Transport endpoint is not connected". In dht_dir_lookup_cbk| dht_revalidate_cbk|dht_discover_complete call dht_call_dir_xattr_heal to heal custom extended attribute. In case of gnfs server if hashed subvol has not found based on loc then wind a call on all subvol to update xattr. Fix: 1) Save MDS subvol on inode ctx 2) Check if mds subvol is present on inode ctx 3) If mds subvol is down then call unwind with error ENOTCONN and if it is up then set new xattr "GF_DHT_XATTR_MDS" to -1 and wind a call on other subvol. 4) If setxattr fop is successful on non-mds subvol then increment the value of internal xattr to +1 5) At the time of directory_lookup check the value of new xattr GF_DHT_XATTR_MDS 6) If value is not 0 in dht_lookup_dir_cbk(other cbk) functions then call heal function to heal user xattr 7) syncop_setxattr on hashed_subvol to reset the value of xattr to 0 if heal is successful on all subvol. Test : To reproduce the issue followed below steps 1) Create a distributed volume and create mount point 2) Create some directory from mount point mkdir tmp{1..5} 3) Kill any one brick from the volume 4) Set extended attribute from mount point on directory setfattr -n user.foo -v "abc" ./tmp{1..5} It will throw error " Transport End point is not connected " for those hashed subvol is down 5) Start volume with force option to start brick process 6) Execute getfattr command on mount point for directory 7) Check extended attribute on brick getfattr -n user.foo <volume-location>/tmp{1..5} It shows correct value for directories for those xattr fop were executed successfully. Note: The patch will resolve xattr healing problem only for fuse mount not for nfs mount. BUG: 1371806 Signed-off-by: Mohit Agrawal <moagrawa@redhat.com> Change-Id: I4eb137eace24a8cb796712b742f1d177a65343d5
* cluster/afr: Make choose-local "reconfigurable"Krutika Dhananjay2017-09-301-0/+11
| | | | | | | | | | With this change, enabling choose-local (which means its state makes transition from "off" to "on") will be effective after the first gfid-lookup on "/" since volume-set was executed. Change-Id: Ibab292ba705d993b475cd0303fb3318211fb2500 BUG: 1480525 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
* cluster/ec: FORWARD_NULL coverity fixAkarsha Rai2017-09-291-1/+1
| | | | | | | | | | Problem: ctx pointer could be NULL Solution: Updated the code to verify ctx pointer BUG: 789278 Change-Id: I25e07a07c6ebe2f630c99ba3aa9a61656fbaa981 Signed-off-by: Akarsha Rai <akrai@redhat.com>
* cluster/ec: FORWARD_NULL coverity fixAkarsha Rai2017-09-291-0/+1
| | | | | | | | | | | | | Problem: cbk could be NULL. Solution: Returning NULL when memory is not allocated for cbk. BUG: 789278 Change-Id: Iea9128e0f3b95100deca560f690f9baaae226abf Signed-off-by: Akarsha Rai <akrai@redhat.com>
* dht: fix a coverity error of type - UNREACHABLEKamal Mohanan2017-09-281-3/+0
| | | | | | | | | | | | | | Problem: Unreachable assignment statement at dht-rebalance.c:1040 Fix: Delete line dht-rebalance.c:1040. The goto statements at lines 1037 and 1031 are also deleted since both branches of the if statement finally go to the same immediately-following label anyway. Change-Id: I5f47ea99244cae2a0a9f2aec7284faadf2ea286a BUG: 789278 Signed-off-by: Kamal Mohanan <kmohanan@redhat.com>
* cluster/ec: FORWARD_NULL coverity fixAkarsha Rai2017-09-281-1/+3
| | | | | | | | | | Problem: Pool pointer could be NULL while destroying it. Solution: Verifying pointer before destroying it. BUG: 789278 Change-Id: I497d1310aa47cb749a4c992aa961bd4dfa23ee48 Signed-off-by: Akarsha Rai <akrai@redhat.com>
* afr: don't check for file size in afr_mark_source_sinks_if_file_emptyRavishankar N2017-09-271-6/+7
| | | | | | | | | ... for AFR_METADATA_TRANSACTION and just mark source and sinks if metadata is the same. Change-Id: I69e55d3c842c7636e3538d1b57bc4deca67bed05 BUG: 1491670 Signed-off-by: Ravishankar N <ravishankar@redhat.com>
* Coverity Issue Fix : CHECKED_RETURNSubha sree Mohankumar2017-09-261-1/+1
| | | | | | | | | | Issue :Event check_return: Calling "ec_dict_set_number" without checking return value. Fix : Type casted the return value of the function "ec_dict_set_number" to void. Change-Id: Id97034f9b1b8591536d63dca680ca7c7a9c4fcc3 BUG: 789278 Signed-off-by: Subha sree Mohankumar <smohanku@redhat.com>
* Fix a coverity error of checker type: CHECKED_RETURNKamal Mohanan2017-09-261-1/+1
| | | | | | | | | | | Problem: dht_frame_return was being called without checking the return value. Solution: Typecast the value returned by the function to void. Change-Id: Idfc6a7ed467d1c8f5f8d09ec26d9059f3d23b760 BUG: 789278 Signed-off-by: Kamal Mohanan <kmohanan@redhat.com>
* afr: auto-resolve split-brains for zero-byte filesRavishankar N2017-09-263-0/+78
| | | | | | | | | | | | | | | | | | | | | | | | Problems: As described in BZ 1491670, renaming hardlinks can result in data/mdata split-brain of the DHT link-to files (T files) without any mismatch of data and metadata. As described in BZ 1486063, for a zero-byte file with only dirty bits set, arbiter brick will likely be chosen as the source brick. Fix: For zero byte files in split-brain, pick first brick as a) data source if file size is zero on all bricks. b) metadata source if metadata is the same on all bricks In arbiter case, if file size is zero on all bricks and there are no pending afr xattrs, pick 1st brick as data source. Change-Id: I0270a9a2f97c3b21087e280bb890159b43975e04 BUG: 1491670 Signed-off-by: Ravishankar N <ravishankar@redhat.com> Reported-by: Rahul Hinduja <rhinduja@redhat.com> Reported-by: Mabi <mabi@protonmail.ch>
* cluster/afr: Sending subvol up/down events when subvol comes up or goes downkarthik-us2017-09-201-0/+2
| | | | | | Change-Id: I6580351b245d5f868e9ddc6a4eb4dd6afa3bb6ec BUG: 1493539 Signed-off-by: karthik-us <ksubrahm@redhat.com>