summaryrefslogtreecommitdiffstats
path: root/xlators
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* snapshot: lvm cleanup during snapshot removeSunny Kumar2017-11-081-7/+13
| | | | | | | | | | | Problem : During snapshot remove lvm cleanup was skipped for deactivated snapshots by assuming that its mount point is not present. Fix : Do no skip lvm cleanup by checking active mount point. Change-Id: I856d2d647c75db8b37b7f430277daef6eb7580a8 BUG: 1509254 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
* features/changelog: Coverity Error Check ReturnVishal Pandey2017-11-081-3/+4
| | | | | | | | If condition to check error in lseek wrapper sys_lseek. Change-Id: Ic96ddbb0898146bbfae11acc86818d6604e5eb98 BUG: 789278 Signed-off-by: Vishal Pandey <vishpandey2014@gmail.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>
* snapview: Coverity FixesAshish Pandey2017-11-082-1/+3
| | | | | | | | | Coverity ID: 259 Coverity ID: 163 Change-Id: I7f7753b870715e1176826fb8dfbe81119750d113 BUG: 789278 Signed-off-by: Ashish Pandey <aspandey@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>
* protocol/server: Add an argument to rpcsvc_program_registerMohammed Rafi KC2017-11-071-1/+2
| | | | | | | | | | | | Because of the conflicts between changes [1] and [2], a new argument was missed from the caller of rpcsvc_program_register. [1] : Id0a2da3632516dc1a5560dde2b151b2e5f0be8e5 [2] : I45c3dcdbf39ec90ba39d914432d13a2ace00a5ee Change-Id: If53f755727f1bb23e0b9fb45ebf25fbc80d770a2 BUG: 1510324 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
* xlators/mgmt/glusterd/: Coverity Issue MISSING_BREAK in ↵Girjesh Rajoria2017-11-071-1/+2
| | | | | | | | | | | | | | glusterd_op_stage_rebalance Coverity ID: 297, 298 Issue: Event unterminated_case Added Fall through in comment. Change-Id: Ied742e64d9741cc974906921dcca80f0b738b7d6 BUG: 789278 Signed-off-by: Girjesh Rajoria <grajoria@redhat.com>
* rpc: bring a new protocol versionAmar Tumballi2017-11-075-0/+373
| | | | | | | | | | * xdr: add gfid to on wire format for fsetattr/rchecksum * as it is change in on wire XDR format, needed backward compatible RPC programs. Signed-off-by: Amar Tumballi <amarts@redhat.com> BUG: 827334 Change-Id: Id0a2da3632516dc1a5560dde2b151b2e5f0be8e5
* xlators/client-rpc-fops: Fix Coverity IssuesMohammed Azhar Padariyakam2017-11-061-2/+2
| | | | | | | | | | | | | | | | | | Coverity Id: 803, 804 from [1] Problem: USE_AFTER_FREE code at client3_3_lookup: 3371 USE_AFTER_FREE at client3_3_readdir: 5562 Solution: Postponed iobuf_unref(rsp_iobuf) to a location after all dereferences of rsp_iobuf [1]:https://download.gluster.org/pub/gluster/glusterfs/static-analysis/master/glusterfs-coverity/2017-10-30-9aa574a5/html/ Change-Id: I34f90d72b1248e5526ff1d2b3273cdab619cf4f8 BUG: 789278 Signed-off-by: Mohammed Azhar Padariyakam <mpadariy@redhat.com>
* rpc: optimize fop program lookupMilind Changire2017-11-065-7/+13
| | | | | | | | | | Ensure that the fop program is the first in the program list so that there's minimum amount of time spent to search the program for the most frequently needed use case. Change-Id: I45c3dcdbf39ec90ba39d914432d13a2ace00a5ee BUG: 1509647 Signed-off-by: Milind Changire <mchangir@redhat.com>
* xlators/mgmt/glusterd/: DEADCODE in client_graph_set_rda_optionsGirjesh Rajoria2017-11-061-1/+1
| | | | | | | | | | | | | Coverity ID: 137 Issue: Event dead_error_begin: Execution cannot reach this statement: "set_graph_errstr(graph, "in...". Assigned return value of gf_string2bytesize_uint64 () to ret. Change-Id: Ibef1b1398b233f6442b23282f5ca205c1869a8ee BUG: 789278 Signed-off-by: Girjesh Rajoria <grajoria@redhat.com>
* stack: change gettimeofday() to clock_gettime()Amar Tumballi2017-11-062-14/+14
| | | | | | | | | | | | For achieving the above, needed below changes too. * more sanity into how 'frame->op' is assigned. * infra to have 'stats' as separate section in 'xlator_t' structure Updates #137 Change-Id: I36679bf9577f3ed00a695b4e7d92870dcb3db8e1 Signed-off-by: Amar Tumballi <amarts@redhat.com>
* xlators/client-rpc-fops: Fix Coverity IssuesMohammed Azhar Padariyakam2017-11-061-23/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | Coverity Id: 557,175,177,184,711,182,180,181,178 from [1] Problem: Unreachable code at client3_3_fgetxattr: 4771 Unreachable code at client3_3_fxattrop: 5087 Unreachable code at client3_3_getxattr: 4890 Unreachable code at client3_3_lookup: 3412 Unreachable code at client3_3_readdir: 5604 Unreachable code at client3_3_readdirp: 5704 Unreachable code at client3_3_xattrop: 4982 NULL checking deref ptr at client3_3_compound: 6045 Unused Value for op_errno at client3_3_getxattr: 4859 Solution: Removed The Unreachable Dead Code Removed NULL Check of dereferenced pointer Removed assignment of op_errno which is overwritten later [1]:https://download.gluster.org/pub/gluster/glusterfs/static-analysis/master/glusterfs-coverity/2017-10-30-9aa574a5/html/ Change-Id: Ie26a026dd1475c892faf00dd844bf38092e0a780 BUG: 789278 Signed-off-by: Mohammed Azhar Padariyakam <mpadariy@redhat.com>
* server-helpers: Coverity Fix CONSTANT_EXPRESSION_RESULT in serialize_rsp_direntpMohammed Azhar Padariyakam2017-11-061-2/+5
| | | | | | | | | | | | | | | | | | Issue : "trav->dict.dict_len > 4294967295U" is always false regardless of the values of its operands. .But dict_serialized_length can return < 0 when error happens. Solution : Remove the comparison which always turns out to be false and add a new condition for error checking. Fix : The if-condition was renewed. Coverity-Id: 108 from [1] [1]: https://download.gluster.org/pub/gluster/glusterfs/static-analysis/master/glusterfs-coverity/2017-10-30-9aa574a5/html/ Change-Id: I9956b6ca7c4bf7444f19aadd3b32fceac011a44e BUG: 789278 Signed-off-by: Mohammed Azhar Padariyakam <mpadariy@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>
* glusterd: Fix few coverity errorsPrashanth Pai2017-11-066-11/+34
| | | | | | | | | | | Fixes issues 810, 248, 491, 499, 85, 786, 811, 43, and 44 from the report at [1]. [1]: https://download.gluster.org/pub/gluster/glusterfs/static-analysis/master/glusterfs-coverity/2017-10-30-9aa574a5/html/ BUG: 789278 Change-Id: I27ebae2ffb2256b8eef0757d768cc46e5a942e9f Signed-off-by: Prashanth Pai <ppai@redhat.com>
* glusterd: Changed default op-version for some optionsShyamsundarR2017-11-062-6/+6
| | | | | | | | | | As 3.13 is branched at a point that includes the features that are changed with this commit, their minimum supported op-versions should also change to 3.13. Change-Id: I7ef8eccc13a16f93939c1edbff9508d1e167c5e4 BUG: 1509412 Signed-off-by: ShyamsundarR <srangana@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-054-13/+52
| | | | | | | | | 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>
* xlators/bd-helper: Coverity Fix CHECKED_RETURN in bd_do_ioctl_zerofillMohammed Azhar Padariyakam2017-11-031-1/+6
| | | | | | | | | | | | | | | Problem: bd_do_ioctl_zerofill is called and return value is unchecked Fix: Check the returned value and goto skip if the returned value < 0 which means its an error. Coverity Id: 67 from [1] [1]: https://download.gluster.org/pub/gluster/glusterfs/static-analysis/master/glusterfs-coverity/2017-10-30-9aa574a5/html/ Change-Id: I398873cefaca03f9cd188fa0f4ccba1378a60ed9 BUG: 789278 Signed-off-by: Mohammed Azhar Padariyakam <mpadariy@redhat.com>
* glusterd: coverity fixesSanju Rakonde2017-11-031-2/+15
| | | | | | | | This patch fixes coverity issue 780, 88, 692, 747, 357 Change-Id: I44b0fe9119853a6d2210507c7247e168d7c3ae0a BUG: 789278 Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* xlators/performance/io-cache/: DEADCODE in ioc_open_cbkGirjesh Rajoria2017-11-031-8/+0
| | | | | | | | | | | | | | Coverity ID: 173 Issue: Event dead_error_line: Execution cannot reach this statement: "fd_ctx_set(fd, this, 1UL);". Removed if block as "weight == 0U" cannot be true, so if block will never execute. Also removed weight variable because it is unused. Change-Id: I4f028df29bfde91167fb15befa99b1fe1892adc6 BUG: 789278 Signed-off-by: Girjesh Rajoria <grajoria@redhat.com>
* glusterd/mgmt: coverity fixesSanju Rakonde2017-11-031-12/+6
| | | | | | | | | | | | | | | | | | | This patch fixes coverity issues 179, 59. Problem: control flow won't enter into if block as volname is always NULL and return value of function synctask_barrier_init is unchecked. Fix: remove condition checking which is always resulting in false, and removing if block which is always unreachable. As a result of removal of condition checking volname became a unused variable, so remove declaration of volname. assign return valur of synctask_barrier_init to ret, if it nonzero value goto out. Change-Id: I870aeb020034e97a761e9314f7ace7573f7c520c BUG: 789278 Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* core: make gf_boolean_t a C99 bool instead of an enumJeff Darcy2017-11-036-9/+23
| | | | | | | | | | | | 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>
* glusterd: UNUSED VALUE coverity fixSanju Rakonde2017-11-021-0/+2
| | | | | | | | | ret is overwritten before it is used, adding a line for checking its value solves it. Change-Id: I4ac4ad33bc236d9294da64b19d16b3bc9bb8807b BUG: 789278 Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* glusterd: PW.INCLUDE_RECURSION coverity fixSanju Rakonde2017-11-021-1/+0
| | | | | | | | | | | Problem: #include file "glusterd.h" includes itself, glusterd.h -> glusterd-pmap.h -> glusterd.h Fix: remove inclusion statement Change-Id: I28f2043a73a50ae2c7b670e2dece4a3f3fffbcd6 BUG: 789278 Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* glusterd/pmap: UNUSED VALUE coverity fixSanju Rakonde2017-11-021-1/+0
| | | | | | | | | | | Problem: port value is assigned to p, which is overwritten before using it. Fix: remaoval of assignment line. Change-Id: If007167f37b0325c7bfe12f8e9075ca68524e40a BUG: 789278 Signed-off-by: Sanju Rakonde <srakonde@redhat.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>
* nfs: Fix crash bug when mnt3_resolve_subdir_cbk() failsShreyas Siravara2017-11-011-0/+3
| | | | | | | | | | | | | | | Summary: When mnt3_resolve_subdir_cbk() fails (this can happen when racing operations), authorized_path is sometimes NULL. We try to run strlen() on this path and as a result we crash. This diff fixes that by checking if path is NULL before dereferencing it. Test Plan: Run with patch and observe that there is no crash. Prove test for auth code. BUG: 1365683 Change-Id: I2e2bdfdc61ae906788611e151d2c753b79b312df Signed-off-by: Shreyas Siravara <sshreyas@fb.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>
* glusterd: fix brick restart parallelismAtin Mukherjee2017-11-016-32/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | glusterd's brick restart logic is not always sequential as there is atleast three different ways how the bricks are restarted. 1. through friend-sm and glusterd_spawn_daemons () 2. through friend-sm and handling volume quorum action 3. through friend handshaking when there is a mimatch on quorum on friend import. In a brick multiplexing setup, glusterd ended up trying to spawn the same brick process couple of times as almost in fraction of milliseconds two threads hit glusterd_brick_start () because of which glusterd didn't have any choice of rejecting any one of them as for both the case brick start criteria met. As a solution, it'd be better to control this madness by two different flags, one is a boolean called start_triggered which indicates a brick start has been triggered and it continues to be true till a brick dies or killed, the second is a mutex lock to ensure for a particular brick we don't end up getting into glusterd_brick_start () more than once at same point of time. Change-Id: I292f1e58d6971e111725e1baea1fe98b890b43e2 BUG: 1506513 Signed-off-by: Atin Mukherjee <amukherj@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>
* snapshot: fix coverity issue 'DEADCODE'Sunny Kumar2017-10-311-11/+1
| | | | | | | | | | | | | | Problem : Unreachable code at glusterd-snapshot.c:6718 Unreachable code at glusterd-snapshot.c:7352 FIx : Remove unreachable code At glusterd-snapshot.c:6718 in if condition the value of "snap" must be "NULL" to call glusterd_snap_remove() which is not possible here. Change-Id: Id865bde7c1474a9b9ed11c0ed614676b4e2443c6 BUG: 789278 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
* glusterd: delete source brick only once in reset-brick commit forceAtin Mukherjee2017-10-311-1/+1
| | | | | | | | | | | While stopping the brick which is to be reset and replaced delete_brick flag was passed as true which resulted glusterd to free up to source brick before the actual operation. This results commit force to fail failing to find the source brickinfo. Change-Id: I1aa7508eff7cc9c9b5d6f5163f3bb92736d6df44 BUG: 1507466 Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
* Xlators/features: Coverity Issue "NEGATIVE_RETURNS" in ↵Subha sree Mohankumar2017-10-311-5/+20
| | | | | | | | | | | | | | | | worm_truncate,worm_ftruncate,worm_link,worn_unlink and worm_rename. Issue :Event negative_returns: "op_errno" is passed to a parameter that cannot be negative. Fix : In functions worm_link,worm_unlink,worm_truncate,worm_ftruncate and worm_rename, added an condition to check the whether value of "op_errno" is negative or not.If the value is negative, then it is set to EROFS. Change-Id: Ie65601b6cc9799f587cc574408281dab50a58afb BUG: 789278 Signed-off-by: Subha sree Mohankumar <smohanku@redhat.com>
* glusterd: clean up portmap on brick disconnectAtin Mukherjee2017-10-314-11/+46
| | | | | | | | | | | | | | | | | | | | GlusterD's portmap entry for a brick is cleaned up when a PMAP_SIGNOUT event is initiated by the brick process at the shutdown. But if the brick process crashes or gets killed through SIGKILL then this event is not initiated and glusterd ends up with a stale port. Since GlusterD's portmap traversal happens both ways, forward for allocation and backward for registry search, there is a possibility that glusterd might end up running with a stale port for a brick which eventually will end up with clients to fail to connect to the bricks. Solution is to clean up the port entry in case the process is down as part of the brick disconnect event. Although with this the handling PMAP_SIGNOUT event becomes redundant in most of the cases, but this is the safeguard method to avoid glusterd getting into the stale port issues. Change-Id: I04c5be6d11e772ee4de16caf56dbb37d5c944303 BUG: 1503246 Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
* glusterd: persist brickinfo's port change into glusterd's storeGaurav Yadav2017-10-315-10/+62
| | | | | | | | | | | | | | | | | | Problem: Consider a case where node reboot is performed and prior to reboot brick was listening to 49153. Post reboot glusterd assigned 49152 to brick and started the brick process but the new port was never persisted. Now when glusterd restarts glusterd always read the port from its persisted store i.e 49153 however pmap signin happens with the correct port i.e 49152. Fix: Make sure when glusterd_brick_start is called, glusterd_store_volinfo is eventually invoked. Change-Id: Ic0efbd48c51d39729ed951a42922d0e59f7115a1 BUG: 1506589 Signed-off-by: Gaurav Yadav <gyadav@redhat.com>
* write once read many: file appendable in worm stateVishal Pandey2017-10-301-10/+1
| | | | | | | | | | | | | | | | | | | | Issue: A new file is appendable even when file level worm is 1. Fix: Do a state transition in writev function in worm.c file. Steps To Test: 1- Activate file level worm. 2- Create a new file. 3- Leave file dormant for auto commit period. 4- Try and append some content to the file. 5- check the file if new content has been appended or not. 6- check if file has been transitioned to Worm Retention state. Change-Id: I52d50ad888cb0c39ad54be9352ccb07d48b8d71a BUG: 1505807 Signed-off-by: Vishal Pandey <vishpandey2014@gmail.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>
* posix: Ignore disk space reserve check for internal FOPSMohit Agrawal2017-10-305-36/+36
| | | | | | | | | | | | | Problem: Currently disk space reserve check is applicable for internal FOP also it needs to be ignore for internal FOP. Solution: Update the DISK_SPACE_CHECK_AND_GOTO macro at posix component. Macro will call only while key "GLUSTERFS_INTERNAL_FOP_KEY" exists in xdata. BUG: 1506083 Change-Id: I2b0840bbf4fa14bc247855b024ca136773d68d16 Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
* md-cache: Add additional samba and macOS specific EAs to mdcacheGünther Deschner2017-10-301-6/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Samba ships with a server implementation of the Apple Create Context extension (AAPL) as negotiated by all modern Apple clients. With the support of the AAPL extension, Apple clients will integrate better with Samba servers. The AAPL implementation itself is contained in the Samba vfs_fruit(8) module which has to be activated in Samba. This vfs_fruit module also provides support for macOS alternate data streams which will be represented in EAs. Two standard data streams ("AFP_AfpInfo" and "AFP_Resource") will be stored in the following EAs: * user.org.netatalk.Metadata * user.org.netatalk.ResourceFork For all other data streams, vfs_fruit relies on another Samba vfs module, vfs_streams_xattr(8), to handle these. Although configurable, by default the vfs_streams_xattr module will build EA keynames with a "user.DosStream." prefix. Please note that we have to deal with only one known prefix key, as macOS will happily compose EA keynames like: * user.DosStream.com.apple.diskimages.fsck:$DATA * user.DosStream.com.apple.diskimages.recentcksum:$DATA * user.DosStream.com.apple.metadata:kMDItemWhereFroms:$DATA * user.DosStream.com.apple.quarantine:$DATA * etc. Caching of vfs_fruit specific EAs is crucial for SMB performance and is controlled with the same configuration option "performance.cache-samba-metadata". Guenther Change-Id: Ia7aa341234dc13e1c0057f3d658b7ef711b5d31e BUG: 1499933 Signed-off-by: Guenther Deschner <gd@samba.org>
* protocol/client: handle the subdir handshake properly for add-brickAmar Tumballi2017-10-291-1/+9
| | | | | | | | | There should be different way we handle handshake in case of subdir mount for the first time, and in case of subsequent graph changes. Change-Id: I2a7ba836433bb0a0f4a861809e2bb0d7fbc4da54 BUG: 1505323 Signed-off-by: Amar Tumballi <amarts@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>
* Make sure attach_brick return a proper error codeMichael Scherer2017-10-261-1/+1
| | | | | | | | | | | | | | Coverity warn about "Using uninitialized value "ret".", which is indeed the case. If we can't attach after 15 tries, attach_brick return uninitiliazed return code, which is likely hard to trigger, but bad. I use -1 to follow the UNIX convetion, but there is no specific error code tested by code. Change-Id: I43ad60d25ab169f9cea0db600805ced7f77c37ba BUG: 789278 Signed-off-by: Michael Scherer <misc@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>
* protocol/server: fix the comparision logic in case of subdir mountAmar Tumballi2017-10-241-30/+30
| | | | | | | | | | | | | without the fix, the stat entry on a file would return inode==1 for many files, in case of subdir mount This happened with the confusion of return value of 'gf_uuid_compare()', it is more like strcmp, instead of a gf_boolean return value, and hence resulted in the bug. Change-Id: I31b8cbd95eaa3af5ff916a969458e8e4020c86bb BUG: 1505527 Signed-off-by: Amar Tumballi <amarts@redhat.com>