summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* extras/hooks: Honour all input arguments to scriptsAnoop C S2017-10-314-28/+70
| | | | | | | | | | | | | | | | | Some of the hook scripts were not honouring the arguments with which they are invoked during various volume operations. So make sure that we consider everything while parsing the command line arguments to avoid following warnings: . . . ame: unrecognized option '--first=no' ame: unrecognized option '--version=1' ame: unrecognized option '--volume-op=start' . . . Change-Id: I5b08e5e7f32908c8509e97098a042096b507783e BUG: 1503983 Signed-off-by: Anoop C S <anoopcs@redhat.com>
* glusterd: delete source brick only once in reset-brick commit forceAtin Mukherjee2017-10-312-1/+25
| | | | | | | | | | | 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>
* snapshot/scheduler: handle the exception when SELinux is absentRishabh Dave2017-10-311-2/+7
| | | | | | | | | When SELinux is absent on an given system, snapshot_scheduler.py raises an exception; handle it and report it in the log. Change-Id: I21bc179e090d34f8061063e6d662521ee5046cce BUG: 1502253 Signed-off-by: Rishabh Dave <rishabhddave@gmail.com>
* gfapi: Register/Unregister Upcall events' callbackSoumya Koduri2017-10-3110-95/+713
| | | | | | | | | | | | | | | | | Polling continuously for upcall events is not optimal. Hence new APIs have been added to allow applications to register and unregister upcall events it is interested in along with callback function to be invoked in case of any such upcalls sent by backend server. @TODO: Make changes in upcall xlator so that events are sent to only those clients which either registered callbacks or started polling. Shall be addressed in separate patch. Updates: #315 Change-Id: I40473fd5cf689172ff2d7bb2869756b7fd5bc761 Signed-off-by: Soumya Koduri <skoduri@redhat.com>
* eventsapi: HTTPS support for WebhooksAravinda VK2017-10-313-29/+114
| | | | | | | | | | | | | | | | | First it tries to call URL with verify=True without specifying the cert path, it succeeds if a webhook is HTTP or HTTPS with CA trusted certificates(for example https://github..). If above call fails with SSL error then it tries to get the server certificate and calls URL again. If call fails with SSL error even after using the certificate, then verification will be disabled and logged in the log file. All other errors will be catched and logged as usual. BUG: 1506903 Change-Id: I86a3390ed48b75dffdc7848022af23a1e1d7f076 Signed-off-by: Aravinda VK <avishwan@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-302-10/+8
| | | | | | | | | | | | | | | | | | | | 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>
* tests: Update tier CLI in .t filesN Balachandran2017-10-3022-28/+28
| | | | | | | | Update .t tier tests to use the new tier CLI. Change-Id: I0e7f1769071108d8266fc86378c4466bcaf96e7d BUG: 1505253 Signed-off-by: N Balachandran <nbalacha@redhat.com>
* extras/hooks: Fix getopt usageAnoop C S2017-10-309-9/+9
| | | | | | | | | | | | | | | | | | | | | | | `getopt` does not have an optional argument as '-name'. It should be either '-n' or '--name'(see man getopt(1)). This wrong usage resulted in setting the script name as 'ame' instead of $PROGNAME in most of the hook-scripts. Additionally the following line from DESCRIPTION given for `getopt` shell command expects short options for almost every kind of usage mentioned in SYNOPSIS: . . . If no '-o' or '--options' option is found in the first part, the first parameter of the second part is used as the short options string. . . . Refer http://man7.org/linux/man-pages/man1/getopt.1.html for more clarity on its usage. Change-Id: I95baf5fa8c99025e66b2d83656dd838d4f6048ce BUG: 1503983 Signed-off-by: Anoop C S <anoopcs@redhat.com>
* protocol/client: handle the subdir handshake properly for add-brickAmar Tumballi2017-10-292-6/+35
| | | | | | | | | 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-2613-95/+247
| | | | | | | | | | | | | | | | | 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-257-48/+536
| | | | | | | | | | | 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>
* cli: volume status command is missing in man pageSanju Rakonde2017-10-241-0/+3
| | | | | | | | | | Problem: volume status command is missing gluster manual page. Fix: Adding volume status command to manual page. Change-Id: Ifef18ff3721bc85636a9e7707c50bee2bf9d4a9b BUG: 1505663 Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* cluster/ec: Allow parallel writes in EC if possiblePranith Kumar K2017-10-249-142/+288
| | | | | | | | | | | | | | | | | | 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>
* gluster: IPv6 single stack supportKevin Vigor2017-10-2412-1/+194
| | | | | | | | | | | | | | | | | | | | | | Summary: - This diff changes all locations in the code to prefer inet6 family instead of inet. This will allow change GlusterFS to operate via IPv6 instead of IPv4 for all internal operations while still being able to serve (FUSE or NFS) clients via IPv4. - The changes apply to NFS as well. - This diff ports D1892990, D1897341 & D1896522 to the 3.8 branch. Test Plan: Prove tests! Reviewers: dph, rwareing Signed-off-by: Shreyas Siravara <sshreyas@fb.com> Change-Id: I34fdaaeb33c194782255625e00616faf75d60c33 BUG: 1406898 Reviewed-on-3.8-fb: http://review.gluster.org/16059 Reviewed-by: Shreyas Siravara <sshreyas@fb.com> Tested-by: Shreyas Siravara <sshreyas@fb.com>
* libgfchangelog: Fix possible null pointer dereferenceKotresh HR2017-10-231-6/+6
| | | | | | | | | | If pthread_attr_init fails, gf_msg uses this->name where 'this' is not initialized yet. This patch fixes the same. Change-Id: Ie004cbe1015a0d62fc3b5512e8954c5606eeeb5f Signed-off-by: Kotresh HR <khiremat@redhat.com> BUG: 1505325
* snapshot: Issue with other processes accessing the mounted brickSunny Kumar2017-10-237-44/+333
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added code for unmount of activated snapshot brick during snapshot deactivation process which make sense as mount point for deactivated bricks should not exist. Removed code for mounting newly created snapshot, as newly created snapshots should not mount until it is activated. Added code for mount point creation and snapshot mount during snapshot activation. Added validation during glusterd init for mounting only those snapshot whose status is either STARTED or RESTORED. During snapshot restore, mount point for stopped snap should exist as it is required to set extended attribute. During handshake, after getting updates from friend mount point for activated snapshot should exist and should not for deactivated snapshot. While getting snap status we should show relevent information for deactivated snapshots, after this pathch 'gluster snap status' command will show output like- Snap Name : snap1 Snap UUID : snap-uuid Brick Path : server1:/run/gluster/snaps/snap-vol-name/brick Volume Group : N/A (Deactivated Snapshot) Brick Running : No Brick PID : N/A Data Percentage : N/A LV Size : N/A Fixes: #276 Change-Id: I65783488e35fac43632615ce1b8ff7b8e84834dc BUG: 1482023 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
* glusterfsd: Dereferencing the null pointerSanju Rakonde2017-10-201-1/+2
| | | | | | | | | | | | | | | | Problem: When control reaches to out, one of (iobref, iobuf, frame) can be null.for iobref, iobuf iobref_unref() and iobuf_unref() functions are called respectively, which are using GF_VALIDATE_OR_GOTO(), so there won't be null pointer dereference. But for frame without null checking STACK_DESTROY(frame->root) is called causing null pointer dereference. Fix: adding a line for null checking, the function STACK_DESTROY(frame->root) is called only when frame is not null. Change-Id: I3a6684c11fb7b694b81d6ad4fec3bced5562ad88 BUG: 1503394 Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* extras/hooks: Fix errors reported via shellcheck utilityAnoop C S2017-10-1810-33/+30
| | | | | | Change-Id: I217c6b2a39955f1709bb3452b00d33c2dcb60faa BUG: 1500649 Signed-off-by: Anoop C S <anoopcs@redhat.com>
* doc: Add missing option for bitrot scrub-frequencyKotresh HR2017-10-181-1/+1
| | | | | | | | | The option 'hourly' is supported for 'scrub-frequency' but man page was not reflecting it. Fixed the same. Change-Id: Ida0929c805f6f5332c5dcd94cda9ecf2f4eee20e BUG: 1503510 Signed-off-by: Kotresh HR <khiremat@redhat.com>
* glusterd: documenting server.allow-insecureSanju Rakonde2017-10-181-1/+1
| | | | | | | | | | | | problem: "server.allow-insecure" is invisible in gluster volume set help. Fix: "server.allow-insecure" is defined as NO_DOC type, chainging it to DOC type solve the problem. Change-Id: I327f1e4c1684ff846deb8b7df07d4d8a09073274 BUG: 1503424 Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* gfproxyd: Let glusterd manage gfproxy daemonPoornima G2017-10-1825-86/+928
| | | | | | | Updates: #242 BUG: 1428063 Change-Id: Iaaf2edf99b2ecc75f6d30762c752a6d445c1c826 Signed-off-by: Poornima G <pgurusid@redhat.com>
* stack.h: make sure 'oldgroups' is never nullAmar Tumballi2017-10-181-1/+12
| | | | | | | | If 'oldgroups' is null, it can lead to a crash. Change-Id: I7a4f71256b07dc0ca3b988cad3694c21b150c99e BUG: 789278 Signed-off-by: Amar Tumballi <amarts@redhat.com>
* glusterd : introduce timer in mgmt_v3_lockGaurav Yadav2017-10-177-20/+247
| | | | | | | | | | | | | | | | Problem: In a multinode environment, if two of the op-sm transactions are initiated on one of the receiver nodes at the same time, there might be a possibility that glusterd may end up in stale lock. Solution: During mgmt_v3_lock a registration is made to gf_timer_call_after which release the lock after certain period of time Change-Id: I16cc2e5186a2e8a5e35eca2468b031811e093843 BUG: 1499004 Signed-off-by: Gaurav Yadav <gyadav@redhat.com>
* gfapi: update symbol version of glfd_set_lk_owner to 3.10.7Soumya Koduri2017-10-175-16/+15
| | | | | | | | | | | | | To be able to backport the API glfd_set_lk_owner() to existing stable (3.10, 3.12) releases, change its symbol version to 3.10.7 (upcoming 3.10 release). Also sticking to the norms of the gfapi library, changing the routine name to glfs_fd_set_lkowner() BUG: 1499641 Change-Id: I43d002a24f493770a3daa774dbda2b7ea6d49e37 Signed-off-by: Soumya Koduri <skoduri@redhat.com>
* worm/read-only: Add sentinel NULL key to optionsPrashanth Pai2017-10-172-0/+4
| | | | | | BUG: 1193929 Change-Id: Ibfee382362826556e2e760f9b946c83445d6a08e Signed-off-by: Prashanth Pai <ppai@redhat.com>
* mount/fuse: never fail open(dir) with ENOENTRaghavendra G2017-10-171-0/+7
| | | | | | | | | | 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. Change-Id: I8d07d2ebb5a0da6c3ea478317442cb42f1797a4b BUG: 1500269 Signed-off-by: Raghavendra G <rgowdapp@redhat.com>
* Revert "mount/fuse: report ESTALE as ENOENT"Raghavendra G2017-10-171-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 26d16b90ec7f8acbe07e56e8fe1baf9c9fa1519e. Consider rename (index.new, store.idx) and open (store.idx) being executed in parallel. When we break down operations following sequence is possible. * lookup (store.idx) - as part of open(store.idx) returns gfid1 as the result. * rename (index.new, store.idx) changes gfid of store.idx to gfid2. Note that gfid2 was the nodeid of index.new. Since rename is successful, gfid2 is associated with store.idx. * open (store.idx) resumes and issues open fop to glusterfs with gfid1. open in glusterfs fails as gfid1 doesn't exist and the error returned by glusterfs to kernel-fuse is ENOENT. * kernel passes back the same error to application as a result to open. This error could've been prevented if kernel retries open with gfid2. Interestingly kernel do retry open when it receives ESTALE error. Even though failure to find gfid resulted in ESTALE error, commit 26d16b90ec7f8acb converted that error to ENOENT while sending an error reply to kernel. This prevented kernel from retrying open resulting in error. Change-Id: I2e752ca60dd8af1b989dd1d29c7b002ee58440b4 BUG: 1500269 Signed-off-by: Raghavendra G <rgowdapp@redhat.com>
* project: update coding standardJeff Darcy2017-10-161-75/+245
| | | | | Change-Id: I1d389c8d97ec1491be675bea2ff90898f1209861 Signed-off-by: Jeff Darcy <jdarcy@fb.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>
* mount/fuse : Fix parsing of vol_id for snapshot volumeMohammed Rafi KC2017-10-151-2/+4
| | | | | | | | | | | | | | | | For supporting sub-dir mount, we changed the volid. Which means anything after a '/' in volume_id will be considered as sub-dir path. But snapshot volume has vol_id stracture of /snaps/<volname>/<snapname> which has to be considered as during the parsing. Note 1: sub-dir mount is not supported on snapshot volume Note 2: With sub-dir mount changes brick based mount for quota cannot be executed via mount command. It has to be a direct call via glusterfs Change-Id: I0d824de0236b803db8a918f683dabb0cb523cb04 BUG: 1501235 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
* packaging: manual systemctl daemon reload required after installKaleb S. KEITHLEY2017-10-131-51/+48
| | | | | | | | | | | | | | | | | | | | | | | Use the %systemd_{post,preun,postun_with_restart} macros provided. Previous fix failed to build on koji Fedora 27 and 28 despite building successfully in on Fedora 2x and CentOS 6 in jenkins and Fedora 25 and 26 in koji (but with late warnings emitted at the end of the build.) Examination of the scriptlets (e.g. `rpm -qp --scripts glusterfs-server.rpm`) revealed some ugliness that is addressed by the using %{nil} lines instead of " ;" After this, builds on CentOS 6, and old Fedora 27 rawhide, and koji f27 worked without warnings or errors about macro recursion. Visual inspection of the scripts appears correct. Fresh installs on CentOS 6 and Fedora 27 rawhide worked. Updates from glusterfs-3.12.1 worked. Reported-by: Sam McLeod <rhbugs@auto.smcleod.net> Change-Id: I84e9dbc6ccd17cdfc2f7c025bdbf61e92523da79 BUG: 1495384 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
* md-cache: free "struct mdc_conf" in fini()Niels de Vos2017-10-131-1/+1
| | | | | | Change-Id: Ia3a9b0152b7e36ded584150733e8392be458125c BUG: 1443145 Signed-off-by: Niels de Vos <ndevos@redhat.com>
* gfapi: free xlator_cmdline_option_t when set through glfs_set_xlator_option()Niels de Vos2017-10-131-1/+22
| | | | | | Change-Id: I10c323477534fd50d29460cf71c246378659fca5 BUG: 1443145 Signed-off-by: Niels de Vos <ndevos@redhat.com>