summaryrefslogtreecommitdiffstats
path: root/extras
Commit message (Collapse)AuthorAgeFilesLines
* NFS-Ganesha : Fixing HA script invocation and othersMeghana Madhusudhan2015-04-132-12/+12
| | | | | | | | | | | | | | gluster features.ganesha disable failed invariably. And also, there were problems in unexporting volumes dynamically.Fixed the above problems. Change-Id: I29aa289dc8dc7b39fe0fd9d3098a02097ca8ca0c BUG: 1207629 Signed-off-by: Meghana Madhusudhan <mmadhusu@redhat.com> Reviewed-on: http://review.gluster.org/10199 Reviewed-by: jiffin tony Thottan <jthottan@redhat.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Tested-by: NetBSD Build System
* snapshot/scheduler: Adhering to the common storage for schedulerAvra Sengupta2015-04-102-8/+21
| | | | | | | | | | | | | | | | | | | | Making snapshot scheduler use the common storage shared by nfs, snapshot and geo-rep. The meta volume should be named as gluster_shared_storage, and it should be mounted at "/var/run/gluster/shared_storage/". Each component(nfs, snapshot, and geo-rep) should have their own repos inside the shared storage, and perform their operations in the shared storage Change-Id: I4f670bf089c80037bd2b0716ddf743f48d7411ca BUG: 1210344 Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/10183 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Aravinda VK <avishwan@redhat.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
* snapshot/scheduler: Validate the number of entries in scheduleAvra Sengupta2015-04-101-0/+12
| | | | | | | | | | | | | | | | | | | | | | A valid schedule entry in snapshot schedule must have six elements and adhere to the following format * * * * * | | | | | | | | | +---- Day of the Week (range: 1-7, 1 standing for Monday) | | | +------ Month of the Year (range: 1-12) | | +-------- Day of the Month (range: 1-31) | +---------- Hour (range: 0-23) +------------ Minute (range: 0-59) Change-Id: Idf03a3c43a461295dd3e2026bbcd0420319dd0e0 BUG: 1209408 Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/10169 Reviewed-by: Aravinda VK <avishwan@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
* snapshot/scheduler: Fix deleting of snapshot scheduleAvra Sengupta2015-04-101-9/+10
| | | | | | | | | | | | | | Check if the argument has an attribute before validating the attribute. Change-Id: Ia4c6c91c2fca2ec3e82b47d81fbc19a5e0f17eb4 BUG: 1210204 Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/10168 Reviewed-by: Aravinda VK <avishwan@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
* snapshot/scheduler: Only run if shared storage is mountedAvra Sengupta2015-04-101-39/+70
| | | | | | | | | | | | | | | Before running any snapshot scheduler op command, verify if /var/run/gluster/snaps/shared_storage/ exists and if the shared storage is mounted at it. Change-Id: Ibb6ba6c01c227cacf9a19d1bf9264500373a4ed6 BUG: 1209112 Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/10135 Reviewed-by: Aravinda VK <avishwan@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
* ganesha-ha: more robust pid file handlingKaleb S. KEITHLEY2015-04-082-5/+6
| | | | | | | | | | | fix bug with reading pid file to determine if ganesha.nfsd is running Change-Id: I4050a119e2be93578045a221b67f616e152546d9 BUG: 1188184 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com> Reviewed-on: http://review.gluster.org/10163 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com>
* snapshot/scheduler: Don't append timestamp in scheduled snapshotsAvra Sengupta2015-04-071-7/+11
| | | | | | | | | | | | | | | | | | | | | The scheduled snapshots will now have names as follows: Scheduled-<jobname>-<volume name>. Stopped appending time-stamp in scheduled snapshots because time-stamps are appended in snapshots by default unless explicitly asked not to. Therefore snapshot created from "Job1" of "test_vol" volume will look like Scheduled-Job1-test_vol_GMT-2015.04.02-09.43.02 Change-Id: I75b4a87d265ed55193f08153fd7ffe521cc5ef68 BUG: 1208097 Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/10115 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* snapshot/scheduler: Remove unwanted schedule enable checkAvra Sengupta2015-04-071-109/+74
| | | | | | | | | | | | | | Allow add, edit, list, delete of schedules even when snapshot scheduling is disabled. Change-Id: Ie55ea7d6e9b3fccd914a786cc54bb323ac765a98 BUG: 1209117 Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/10136 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Aravinda VK <avishwan@redhat.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* snapshot/scheduler: Check the correctness of Jobname and VolnameAvra Sengupta2015-04-071-0/+27
| | | | | | | | | | | | | | | | | Check for the correctness of Jobname and Volname. They should not be empty, and should contain only one word. If this condition is met, the rest of the whitespaces are also striped, before processing the command. Change-Id: I2c9503ab86456e0f4b37e31d483ee8b2d0b0e1af BUG: 1209120 Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/10137 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Aravinda VK <avishwan@redhat.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* extras: Fix stop-all-gluster-processes.sh scriptKotresh HR2015-04-061-2/+2
| | | | | | | | | | | | | | "test -n" command takes single string as argument. The command was failing with "Too many arguments" when multiple pids are got. Change-Id: Icc409082f492c72522168d5e203684f00f52cf1b BUG: 1204641 Signed-off-by: Kotresh HR <khiremat@redhat.com> Reviewed-on: http://review.gluster.org/9970 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Aravinda VK <avishwan@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* snapshot/scheduler: Fix the snapshot create command.Avra Sengupta2015-04-041-1/+2
| | | | | | | | | | | | The create command being executed was sent with wrong parameters. Change-Id: I9b3cf23b3a02cf8309d50bf70439ad02b37f191a BUG: 1208067 Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/10114 Reviewed-by: Aravinda VK <avishwan@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* geo-rep: Copy geo-rep hook-script during source installKotresh HR2015-04-021-0/+3
| | | | | | | | | | | | | | | | | The hook-script S56glusterd-geo-rep-create-post.sh was not copying to glusterd working directory when geo-rep is installed through source. Hence the geo-rep create fails unless the script is manually copied. This patch addresses the issue by copying the hook-script during make install. Change-Id: I185a877ed720e8300f0e888ab481d0c8c23bf815 BUG: 1207201 Signed-off-by: Kotresh HR <khiremat@redhat.com> Reviewed-on: http://review.gluster.org/10051 Reviewed-by: Aravinda VK <avishwan@redhat.com> Reviewed-by: Niels de Vos <ndevos@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com> Tested-by: Vijay Bellur <vbellur@redhat.com>
* ganesha-ha: ganesha-ha.sh --status (one-liner) implementationKaleb S. KEITHLEY2015-03-241-0/+1
| | | | | | | | | Change-Id: I17b7f6864dd8c1f89500a4bb89f1c249835e68da BUG: 1188184 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com> Reviewed-on: http://review.gluster.org/9974 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com>
* build: let checkpatch check for a trailing dotNiels de Vos2015-03-231-0/+11
| | | | | | | | | | | | | | | The subject of a patch should not end with a dot (.). It is not common to have subjects of emails end with a dot, and neither is it common for patches. Change-Id: Id090241393aee3ca99df4887bdb2d7a7a8913164 BUG: 1198849 Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/9940 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Ira Cooper <ira@redhat.com> Reviewed-by: Lalatendu Mohanty <lmohanty@redhat.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
* build: correctly install the snap_scheduler toolsNiels de Vos2015-03-191-1/+1
| | | | | | | | | | | | | The current way of installing the snap-scheduler tools breaks the building of RPMs. The tools should be installed in /usr/sbin and there is no need to change the attributes/permissions after the installation. Change-Id: I1b8e206748617fb000d956b1b5da52d126971c29 BUG: 1203557 Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/9939 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* snapshot/scheduling: A cron based scheduler for snapshot schedulingAvra Sengupta2015-03-185-1/+804
| | | | | | | | | | | | | | | | | | | | | | | | | | GlusterFS volume snapshot provides point-in-time copy of a GlusterFS volume. Currently, GlusterFS volume snapshots can be easily scheduled by setting up cron jobs on one of the nodes in the GlusterFS trusted storage pool. This has a single point failure (SPOF), as scheduled jobs can be missed if the node running the cron jobs dies. The solution to the above problems is addressed in this patch. The snap_scheduler.py helper script expects the user to install the argparse python module before using it. Further details for the same are available at: http://www.gluster.org/community/documentation/index.php/Features/Scheduling_of_Snapshot Change-Id: I2c357af5b7d3e66f270d20eef50cdeecdcbe15c7 BUG: 1198027 Signed-off-by: Avra Sengupta <asengupt@redhat.com> Signed-off-by: Aravinda VK <avishwan@redhat.com> Reviewed-on: http://review.gluster.org/9788 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* feature/glusterfind: A tool to find incremental changesAravinda VK2015-03-183-1/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Documentation is available in patch: http://review.gluster.org/#/c/9800/ A tool which helps to get list of modified files or list of all files in GlusterFS Volume using Changelog or find command. Usage ===== glusterfind --help Create: ------- glusterfind create --help The tool creates status file $GLUSTERD_WORKDIR/SESSION/VOLUME/status and records current timestamp to initiate the session. This timestamp will be used as start time for next runs. As part of create also generates ssh key and distributes to all peers. and enables build.pgfid and changelog using volume set command. Pre: ---- glusterfind pre --help This command is used to generate the list of files modified after session creation time or after last run. To get list of all files/dirs in Volume, run pre command with `--full` argument. The tool gets all nodes details using gluster volume info and runs node agent for each brick in respective nodes via ssh command. Once these node agents generate the output file, tool copies to local using scp. Merges all the output files to generate the final output file. Post: ----- glusterfind post --help After consuming the list, this sub command is called to update the session time based on pre command status file. List: ----- glusterfind list --help To view all the sessions Delete: ------- glusterfind delete --help Delete session. Known Issues ------------ 1. Deleted files will not get listed, since we can't convert GFID to Path if file/dir is deleted. 2. Only new name will get listed if Renamed. 3. All hardlinks will get listed. Change-Id: I82991feb0aea85cb6ec035fddbf80a2b276e86b0 BUG: 1193893 Signed-off-by: Aravinda VK <avishwan@redhat.com> Reviewed-on: http://review.gluster.org/9682 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Venky Shankar <vshankar@redhat.com> Reviewed-by: Prashanth Pai <ppai@redhat.com> Reviewed-by: Kotresh HR <khiremat@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* NFS-Ganesha: Install scripts, config files, and resource agent scriptsKaleb S. KEITHLEY2015-03-1712-1/+1355
| | | | | | | | | | | | | | | | | Resubmitting after a gerrit bug bungled the merge of http://review.gluster.org/9621 (was it really a gerrit bug?) Scripts related to NFS-Ganesha are in extras/ganesha/scripts. Config files are in extras/ganesha/config. Resource Agent files are in extras/ganesha/ocf Files are copied to appropriate locations. Change-Id: I137169f4d653ee2b7d6df14d41e2babd0ae8d10c BUG: 1188184 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com> Reviewed-on: http://review.gluster.org/9912 Tested-by: Gluster Build System <jenkins@build.gluster.com>
* build: adjust checkpatch for HEAD.Michael Scherer2015-03-051-1/+2
| | | | | | | | | | | | | README is called README.md in git HEAD, and we have a directory heal. Change-Id: I2e698b95c6924b5b21aa54257fefd6a6698255ee BUG: 1198849 Signed-off-by: Michael Scherer <misc@zarb.org> Reviewed-on: http://review.gluster.org/9784 Reviewed-by: Humble Devassy Chirammal <humble.devassy@gmail.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com>
* geo-rep: Handle copying of common_secret.pem.pub to slave correctly.Kotresh HR2015-01-211-4/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current Behaviour: 1. Geo-replication gsec_create creates common_secret.pem.pub file containing public keys of the all the nodes of master cluster in the location /var/lib/glusterd/ 2. Geo-replication create push-pem copies the common_secret.pem.pub to the same location on all the slave nodes with same name. Problem: Wrong public keys might get copied on to slave nodes in multiple geo-replication sessions simultaneosly. E.g. A geo-rep session is established between Node1(vol1:Master) to Node2 (vol2:Slave). And one more geo-rep session where Node2 (vol3) becomes master to Node3 (vol4) as below. Session1: Node1 (vol1) ---> Node2 (vol2) Session2: Node2 (vol3) ---> Node3 (vol4) If steps followed to create both geo-replication session is as follows, wrong public keys are copied on to Node3 from Node2. 1. gsec_create is done on Node1 (vol1) -Session1 2. gsec_create is done on Node2 (vol3) -Session2 3. create push-pem is done Node1 - Session1. -This overwrites common_secret.pem.pub in Node2 created by gsec_create in second step. 4. create push-pem on Node2 (vol3) copies overwrited common_secret.pem.pub keys to Node3. -Session2 Consequence: Session2 fails to start with Permission denied because of wrong public keys Solution: On geo-rep create push-pem, don't copy common_secret.pem.pub file with same name on to all slave nodes. Prefix master and slave volume names to the filename. NOTE: This brings change in manual steps to be followed to setup non-root geo-replication (mountbroker). To copy ssh public keys, extra two arguments needs to be followed. set_geo_rep_pem_keys.sh <mountbroker_user> <master vol name> \ <slave vol name> Path to set_geo_rep_pem_keys.sh: Source Installation: /usr/local/libexec/glusterfs/set_geo_rep_pem_keys.sh Rpm Installatino: /usr/libexec/glusterfs/set_geo_rep_pem_keys.sh Change-Id: If38cd4e6f58d674d5fe2d93da15803c73b660c33 BUG: 1183229 Signed-off-by: Kotresh HR <khiremat@redhat.com> Reviewed-on: http://review.gluster.org/9460 Reviewed-by: Aravinda VK <avishwan@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Venky Shankar <vshankar@redhat.com> Tested-by: Venky Shankar <vshankar@redhat.com>
* build: add a tmpfiles.d config file for /run/glusterNiels de Vos2015-01-192-0/+7
| | | | | | | | | | | | | | | | | | New distrubutions have a /run directory on a volatile tmpfs filesystem. This causes /run/gluster to be removed with each reboot. A tmpfiles.d configuration is used to create the directory on boot. EL5 and EL-6 do not use /run, current Fedora versions do. By checking %{_tmpfilesdir} in the .spec, we can identify if the distribution uses tmpfiles.d. Change-Id: I231e7d6603d573cb905246558e14a51577c0eb56 BUG: 1182934 Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/9458 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-by: Lalatendu Mohanty <lmohanty@redhat.com>
* Stop logrotate from complaining about missing files.Jan-Hendrik Zab2014-12-111-1/+1
| | | | | | | | | | | | | | Previously logrotate reported errors for files missing in "/var/log/glusterfs/geo-replication-slaves/*/*.log". Fixed by reordering directives in the example config. Change-Id: I7cdb9e0d82f08aa27d5e26664660204fdeb8e98e BUG: 1170825 Signed-off-by: Jan-Hendrik Zab <zab@l3s.de> Reviewed-on: http://review.gluster.org/9264 Reviewed-by: Niels de Vos <ndevos@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Lalatendu Mohanty <lmohanty@redhat.com>
* build: only install geo-rep scripts when enabledNiels de Vos2014-12-071-1/+1
| | | | | | | | | | | | | | When geo-replication is not enabled, the related scripts should not get installed. EPEL-5 does not support geo-replication, and the installed but unpackaged scripts cause rebuilding for .el5 to fail. BUG: 1169005 Change-Id: I1b6a352b73bd1ed1c5b330f54e26e81aed9a5a4e Reported-by: Lalatendu Mohanty <lmohanty@redhat.com> Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/9221 Reviewed-by: Humble Devassy Chirammal <humble.devassy@gmail.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* extras: geo-rep: Customize the generate gfid script to dirs listAravinda VK2014-11-261-5/+22
| | | | | | | | | | | generate-gfid-file.sh now accepts dirs list file and generate gfids only for those dirs list. Change-Id: Ia78a0a744dc8a079db56c38578cc6fcac2a6fa90 Signed-off-by: Aravinda VK <avishwan@redhat.com> Reviewed-on: http://review.gluster.org/8540 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* extras/hookscripts: Fix set behaviour for user.cifs and user.smbRaghavendra Talur2014-11-111-12/+28
| | | | | | | | | | | | | | | Setting either of user.cifs or user.smb to disable should disable smb shares when the smb share is already available. Change-Id: I213ffca9cedc14107daeb30271d1f41dd9d7fcf4 BUG: 1105147 Signed-off-by: Raghavendra Talur <rtalur@redhat.com> Reviewed-on: http://review.gluster.org/9042 Reviewed-by: Lalatendu Mohanty <lmohanty@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jose A. Rivera <jarrpa@redhat.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
* logrotate: gluster logrotate config should not be globalLalatendu Mohanty2014-10-292-37/+45
| | | | | | | | | | | | | Issue : Previously glusterfs logrotate config file pollutes global config. So moved the directives inside the curly braces, so they don't pollute the global config state. Change-Id: I8836893dfcdf457d9c5d766612d687bfce64e2ae BUG: 1126802 Signed-off-by: Lalatendu Mohanty <lmohanty@redhat.com> Reviewed-on: http://review.gluster.org/8994 Reviewed-by: Niels de Vos <ndevos@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* Hooks : Infinite while loop introduced by another change.Meghana Madhusudhan2014-10-241-1/+5
| | | | | | | | | | | | | | | A change made to all the hook scripts introduced an infinite while loop in the script S31ganesha-reset.sh. It resulted in 100% CPU usage by this script. Change-Id: If62d8f0e065c6e6511363b8b26eae433f59bc5c3 BUG: 1155489 Signed-off-by: Meghana Madhusudhan <mmadhusu@redhat.com> Reviewed-on: http://review.gluster.org/8966 Reviewed-by: soumya k <skoduri@redhat.com> Reviewed-by: Raghavendra Talur <rtalur@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* Revert "extras: reverse test for '}' vs. following 'else' placement"Harshavardhana2014-10-141-5/+5
| | | | | | | | | | | | | This reverts commit 0a8371bdfdd88e662d09def717cc0b822feb64e8. Change-Id: I946f449ad213cea70fbbd9cd3951f5838b9f82e5 BUG: 1120646 Signed-off-by: Harshavardhana <harsha@harshavardhana.net> Reviewed-on: http://review.gluster.org/8927 Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-by: Niels de Vos <ndevos@redhat.com> Tested-by: Niels de Vos <ndevos@redhat.com>
* extras: reverse test for '}' vs. following 'else' placementJeff Darcy2014-10-021-5/+5
| | | | | | | | | | | | The two-line form "}\nelse {" has been more common than the one-line form "} else {" in our code for years, and IMO for good reason (see the comment in the diff). Change-Id: Ic22c76fe76f0d91300daff36e755a18a8db58852 Signed-off-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-on: http://review.gluster.org/8888 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* build: remove warnings for recommended styleJeff Darcy2014-09-231-51/+2
| | | | | | | | | | | | | | | | | | | | | | Specifically: * space before function arguments * brace around single statement Ideally we would *reverse* these tests so they warn under the exact opposite conditions, but that would mean learning the internals of a script written in a defective language with cryptic variable names and too few comments. Life's too short. For now, just cutting down on some of the spam (which might obscure more serious issues) should suffice. BUG: 1120646 Change-Id: I5ec684d0d788a34f29af9b1761743c8860973993 Signed-off-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-on: http://review.gluster.org/8813 Reviewed-by: Harshavardhana <harsha@harshavardhana.net> Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: Harshavardhana <harsha@harshavardhana.net>
* extras/checkpatch.pl: update coding guidelines scriptHarshavardhana2014-09-231-12/+1
| | | | | | | | | | | | | | - Allow 'quoted string split across lines' since its a GlusterFS common practice - Remove a useless "+" - perl 5.20 complains with following warning "Useless use of greediness modifier '+'" Change-Id: Ibaf276ec84757b3ecc3e6db7f5e720b8e8a12dff BUG: 1120646 Signed-off-by: Harshavardhana <harsha@harshavardhana.net> Reviewed-on: http://review.gluster.org/8811 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
* extras/checkpatch.pl: linux kernel style patch verificationHarshavardhana2014-09-181-0/+4384
| | | | | | | | | | | | | | | | | | | | | | | | | | This is to bring in adherence to coding policy, prior to patch submission for review. - no tabs - no whitespace - indentation (linux style) etc. This is in the interest at large for the GlusterFS codebase to be more cleaner and readable. ./rfc.sh - now supports running this for all patches diverged from "origin/master" revision. NOTE: One should take this as a handle for good guidelines and never use it as a tool for correctness, use common-sense in all the cases ;-) Change-Id: Ib9a5ed207cde152cb92b8d38cec83e8ce9ef7f28 BUG: 1120646 Signed-off-by: Harshavardhana <harsha@harshavardhana.net> Reviewed-on: http://review.gluster.org/8181 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anders Blomdell <anders.blomdell@control.lth.se>
* osx: LaunchDaemon plist filename should start with org instead of comJustin Clift2014-09-152-2/+2
| | | | | | | | | Change-Id: I5e06bcc473224667387c555355d7e1e81bf4911b BUG: 1141659 Reviewed-on: http://review.gluster.org/8734 Reviewed-by: Harshavardhana <harsha@harshavardhana.net> Tested-by: Harshavardhana <harsha@harshavardhana.net> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* osx: Remove legacy extras/MacOSX directoryJustin Clift2014-09-153-116/+6
| | | | | | | | | | BUG: 1141682 Change-Id: Ic84171b070985a11b70d4548aa5e507a121d2164 Signed-off-by: Justin Clift <justin@gluster.org> Reviewed-on: http://review.gluster.org/8736 Reviewed-by: Harshavardhana <harsha@harshavardhana.net> Tested-by: Harshavardhana <harsha@harshavardhana.net> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* Hook scripts should exit with correct exit status.Meghana Madhusudhan2014-08-312-9/+16
| | | | | | | | | | | | | | | | | | When volume set options other than nfs-ganesha.host and nfs-ganesha.enable are executed, the hook script S31ganesha-set.sh should exit with exit status 0. The present behaviour results in an error message in one of the logs that could be misleading. Similarly, hook script S30samba-set.sh should exit with exit status 0 if samba is not installed. Fixing the issue with a minor change in the script. Change-Id: I35d1dc8400bb7043385800ed97adc5321829437f BUG: 1122978 Signed-off-by: Meghana Madhusudhan <mmadhusu@redhat.com> Reviewed-on: http://review.gluster.org/8385 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* Regression test portability: mktempEmmanuel Dreyfus2014-08-204-4/+4
| | | | | | | | | | | | | | Linux mktemp accepts to run without a template, NetBSD mandates it. Since the template option has the same syntax, add it everywhere. While there, also do this in scripts outside of regression testing. BUG: 764655 Change-Id: I3ec140afbc9009257c81a56d77afcc21fef74cc4 Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/8432 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Harshavardhana <harsha@harshavardhana.net> Tested-by: Harshavardhana <harsha@harshavardhana.net>
* who-wrote-glusterfs: use the set $GITDM_REPO variablePatrick Uiterwijk2014-08-191-1/+1
| | | | | | | | | | | Change-Id: Ic119f83fff3930e164f3c81df1c9b60d5eb2d99f BUG: 1131272 Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com> Reviewed-on: http://review.gluster.org/8495 Reviewed-by: Humble Devassy Chirammal <humble.devassy@gmail.com> Reviewed-by: Niels de Vos <ndevos@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* extras/LinuxRPM: error in Makefile.amKaleb S. KEITHLEY2014-08-081-1/+1
| | | | | | | | | | Change-Id: I50de95ca6eff09338ce4a6f9f2b42aeccd10cae2 BUG: 1128192 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com> Reviewed-on: http://review.gluster.org/8444 Reviewed-by: Lalatendu Mohanty <lmohanty@redhat.com> Reviewed-by: Niels de Vos <ndevos@redhat.com> Tested-by: Niels de Vos <ndevos@redhat.com>
* build: make GLUSTERD_WORKDIR rely on localstatedirHarshavardhana2014-08-0711-123/+138
| | | | | | | | | | | | | | | | | | | | | | - Break-way from '/var/lib/glusterd' hard-coded previously, instead rely on 'configure' value from 'localstatedir' - Provide 's/lib/db' as default working directory for gluster management daemon for BSD and Darwin based installations - loff_t is really off_t on Darwin - fix-off the warnings generated by clang on FreeBSD/Darwin - Now 'tests/*' use GLUSTERD_WORKDIR a common variable for all platforms. - Define proper environment for running tests, define correct PATH and LD_LIBRARY_PATH when running tests, so that the desired version of glusterfs is used, regardless where it is installed. (Thanks to manu@netbsd.org for this additional work) Change-Id: I2339a0d9275de5939ccad3e52b535598064a35e7 BUG: 1111774 Signed-off-by: Harshavardhana <harsha@harshavardhana.net> Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/8246 Tested-by: Gluster Build System <jenkins@build.gluster.com>
* gluster vol set nfs-ganesha.enable off fails to unexport volume.Meghana Madhusudhan2014-08-051-1/+1
| | | | | | | | | | | | | | | | | | Due to a parameter type change in upstream nfs-ganesha ( v2.1 and above ), gluster vol set <volname> nfs-ganesha.enable off doesn't unexport the volume in question if it was already exported. A minor change in the hook script would result in the expected behaviour. Change-Id: I46f76f3cde6b6ebd7a94d5ee16f05a3648a2840f BUG: 1124711 Signed-off-by: Meghana Madhusudhan <mmadhusu@redhat.com> Reviewed-on: http://review.gluster.org/8390 Reviewed-by: soumya k <skoduri@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Humble Devassy Chirammal <humble.devassy@gmail.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* Make RPM's with current git tagAnders Blomdell2014-07-302-5/+21
| | | | | | | | | | | | | | | | 1. clear autom4te.cache 2. autogen.sh 3. configure --with-previous-options Change-Id: I90c1820d22207d18b1bb367444b21918467baea5 BUG: 1117921 Signed-off-by: Anders Blomdell <anders.blomdell@control.lth.se> Reviewed-on: http://review.gluster.org/8293 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Harshavardhana <harsha@harshavardhana.net> Reviewed-by: Humble Devassy Chirammal <humble.devassy@gmail.com> Reviewed-by: Niels de Vos <ndevos@redhat.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
* gluster: Fix the recursive goto outs in the source code.Avra Sengupta2014-07-212-3/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Added a script check_goto.pl, that when run from the source code root, will scan all .c files to match the following pattern: label: if (condition) goto label; On finding such a pattern the script will print the file name and the line number. There are certain cases where the above recursive pattern is intended. Hence adding those labels to ignore-labels. Thanks Vijaikumar Mallikarjuna for the perl script. Also fixed all such existing errors Change-Id: I1b821d0a8c296f16e40faff20bd029bdc880c2e9 BUG: 1119256 Signed-off-by: Vijaikumar Mallikarjuna <vmallika@redhat.com> Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/8307 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
* Changing the position of nfs-ganesha.logMeghana Madhusudhan2014-07-091-1/+8
| | | | | | | | | | | | | | | Changing the position of ganesha.log from /tmp/ganesha.log to /var/log/nfs-ganesha/ganesha.nfsd.log Change-Id: Iff95fbc7fc690f4fdbc1789d84f3e41aaca9045b BUG: 1116723 Signed-off-by: Meghana Madhusudhan <mmadhusu@redhat.com> Reviewed-on: http://review.gluster.org/8249 Reviewed-by: soumya k <skoduri@redhat.com> Reviewed-by: Humble Devassy Chirammal <humble.devassy@gmail.com> Reviewed-by: Raghavendra Talur <rtalur@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* porting: Port for FreeBSD rebased from Mike Ma's effortsHarshavardhana2014-07-023-5/+29
| | | | | | | | | | | | | | | | | | | - Provides a working Gluster Management Daemon, CLI - Provides a working GlusterFS server, GlusterNFS server - Provides a working GlusterFS client - execinfo port from FreeBSD is moved into ./contrib/libexecinfo for ease of portability on NetBSD. (FreeBSD 10 and OSX provide execinfo natively) - More portability cleanups for Darwin, FreeBSD and NetBSD - Provides a new rc script for FreeBSD Change-Id: I8dff336f97479ca5a7f9b8c6b730051c0f8ac46f BUG: 1111774 Original-Author: Mike Ma <mikemandarine@gmail.com> Signed-off-by: Harshavardhana <harsha@harshavardhana.net> Reviewed-on: http://review.gluster.org/8141 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
* extras: add a script to stop all the glusterfs processAmar Tumballi2014-06-171-0/+33
| | | | | | | | | Change-Id: I9f73bf0308625695ed78db06478963d16644852a Signed-off-by: Amar Tumballi <amarts@redhat.com> Reviewed-on: http://review.gluster.org/6270 Reviewed-by: Sachidananda Urs <sacchi@gmail.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* extras: bash command completion for glusterVarun Shastry2014-06-134-2/+507
| | | | | | | | | | Change-Id: Ifd6e68b0288dc65e41e467b4ad02bfc3bded341f BUG: 1108767 Signed-off-by: Varun Shastry <vshastry@redhat.com> Reviewed-on: http://review.gluster.org/7979 Reviewed-by: Lalatendu Mohanty <lmohanty@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* Core: Fix issues reported by CppcheckLalatendu Mohanty2014-06-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed in this patch: [glusterfs/extras/geo-rep/gsync-sync-gfid.c:105]: (error) Resource leak: fp [glusterfs/libglusterfs/src/xlator.c:651]: (error) Uninitialized variable: gfid [glusterfs/libglusterfs/src/xlator.c:652]: (error) Uninitialized variable: gfid [glusterfs/xlators/cluster/ha/src/ha.c:2699]: (error) Possible null pointer dereference: priv [glusterfs/xlators/features/changelog/src/changelog.c:1464]: (error) Possible null pointer dereference: priv [glusterfs/xlators/mgmt/glusterd/src/glusterd-mgmt-handler.c:865]: (error) Possible null pointer dereference: ctx [glusterfs/xlators/mgmt/glusterd/src/glusterd-mgmt-handler.c:194]: (error) Possible null pointer dereference: ctx [glusterfs/xlators/mgmt/glusterd/src/glusterd-syncop.c:1408]: (error) Possible null pointer dereference: this [glusterfs/xlators/mgmt/glusterd/src/glusterd-utils.c:7002]: (error) Possible null pointer dereference: path_tokens Fixed in 3.4 and 3.5 branch (http://review.gluster.org/#/c/7583/ , http://review.gluster.org/#/c/7605/ will be backported in a separate patch) [glusterfs/xlators/mount/fuse/src/fuse-bridge.c:4688]: (error) Uninitialized variable: finh [glusterfs/xlators/mount/fuse/src/fuse-bridge.c:3081]: (error) Possible null pointer dereference: state [glusterfs/xlators/cluster/dht/src/dht-rebalance.c:1719]: (error) Possible null pointer dereference: ctx [glusterfs/xlators/cluster/stripe/src/stripe.c:4940]: (error) Possible null pointer dereference: local [glusterfs/xlators/mgmt/glusterd/src/glusterd-replace-brick.c:915]: (error) Resource leak: file [glusterfs/xlators/mgmt/glusterd/src/glusterd-replace-brick.c:999]: (error) Resource leak: file [glusterfs/xlators/mgmt/glusterd/src/glusterd-sm.c:248]: (error) Possible null pointer dereference: new_ev_ctx [glusterfs/xlators/mgmt/glusterd/src/glusterd-utils.c:5297]: (error) Possible null pointer dereference: this [glusterfs/xlators/mgmt/glusterd/src/glusterd-utils.c:6273]: (error) Possible null pointer dereference: this [glusterfs/xlators/performance/quick-read/src/quick-read.c:586]: (error) Possible null pointer dereference: iobuf [glusterfs/xlators/nfs/server/src/nfs-common.c:89]: (error) Dangerous usage of 'volname' (strncpy doesn't always null-terminate it). False positives [glusterfs/geo-replication/src/gsyncd.c:99]: (error) Memory leak: str [glusterfs/geo-replication/src/gsyncd.c:395]: (error) Memory leak: argv [glusterfs/xlators/nfs/server/src/nlm4.c:1199]: (error) Possible null pointer dereference: fde [glusterfs/xlators/mgmt/glusterd/src/glusterd-geo-rep.c:1659]: (error) Possible null pointer dereference: command [glusterfs/xlators/mgmt/glusterd/src/glusterd-utils.c:7001]: (error) Possible null pointer dereference: path_tokens Insignificant/Don't care [glusterfs/contrib/uuid/gen_uuid.c:369]: (warning) %ld in format string (no. 2) requires 'long *' but the argument type is 'unsigned long *'. [glusterfs/contrib/uuid/gen_uuid.c:369]: (warning) %ld in format string (no. 3) requires 'long *' but the argument type is 'unsigned long *'. [glusterfs/extras/test/test-ffop.c:27]: (error) Buffer overrun possible for long command line arguments. [glusterfs/xlators/cluster/afr/src/afr-self-heal-common.c:138]: (error) Possible null pointer dereference: __ptr [glusterfs/xlators/cluster/afr/src/afr-self-heal-common.c:140]: (error) Possible null pointer dereference: __ptr [glusterfs/xlators/cluster/afr/src/afr-self-heal-common.c:331]: (error) Possible null pointer dereference: __ptr Change-Id: I7696ed1a2a9553b79f9714e10210a8d563a5abd8 BUG: 1091677 Signed-off-by: Lalatendu Mohanty <lmohanty@redhat.com> Reviewed-on: http://review.gluster.org/7693 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* extras/hookscripts: When set option disables smb, don't start smb.Raghavendra Talur2014-06-121-1/+1
| | | | | | | | | | | | | | When user.smb or user.cifs option is set to disable, we remove the share options from smb.conf. If smb process is running, a sighup is required but we should not start the process if its not running. Change-Id: I1e2163ff209ba858380f7da459ff1dba3cf673f2 BUG: 1105123 Signed-off-by: Raghavendra Talur <rtalur@redhat.com> Reviewed-on: http://review.gluster.org/7994 Reviewed-by: Poornima G <pgurusid@redhat.com> Reviewed-by: Niels de Vos <ndevos@redhat.com> Tested-by: Vijay Bellur <vbellur@redhat.com>
* scripts: CTDB lockvol ping-timeout should be 10secsHarshavardhana2014-06-112-30/+32
| | | | | | | | | | | | | | | commit "4044e387dd40e2d12145fd32d5fd715406fcec8e" approach to this led to deadlocks instead we rely on an old trick at client side - without any need to modifying the volume globally. Change-Id: I6e3c6bf9c0a3a0dd99a51b5d2a6c1f050ed2384c BUG: 1091600 Signed-off-by: Harshavardhana <harsha@harshavardhana.net> Reviewed-on: http://review.gluster.org/8007 Reviewed-by: Raghavendra Talur <rtalur@redhat.com> Reviewed-by: Poornima G <pgurusid@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* Hooks/nfs-ganesha:Change the hook script to enable new function signature of ↵Meghana M2014-06-021-54/+56
| | | | | | | | | | | | | | | | | | | | add export. Minor changes in the hook script to avoid some possible confusion when volume set options are used. Adding a few additional checks to ensure correct behaviour. Edited a few config parameters that have changed in upstream ganesha recently. Change-Id: I85b842cbbd4b35b7f72f3beb60abf6532ddaa8c7 BUG: 1101416 Signed-off-by: Meghana M <mmadhusu@redhat.com> Reviewed-on: http://review.gluster.org/7890 Reviewed-by: soumya k <skoduri@redhat.com> Reviewed-by: Raghavendra Talur <rtalur@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>