cluster/afr: Fix fd/memory leak on fsync

Change-Id: I764883811e30ca9d9c249ad00b6762101083a2fe
BUG: 976800
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/5248
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
nfs: Remove afr split-brain handling in nfs

We added this code as an interim fix until afr can
handle split-brains even when opens are not issued.
Afr code has matured to reject fd based fops when
there are split-brains so we can remove it.

Change-Id: Ib337f78eccee86469a5eaabed1a547a2cea2bdcf
BUG: 974972
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/5227
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Ravishankar N <ravishankar@redhat.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
doc: Move admin-guide to markdown format.

Editing markdown is probably more easier than xml.

pandoc can then be used for conversion to html, pdf and any other necessary
formats. Note that pandoc has the following input and output formats:

Input: markdown and (subsets of) Textile, reStructuredText, HTML, LaTeX, and
DocBook XML.

Output:plain text, markdown, reStructuredText, XHTML,  HTML  5,  LaTeX
(including beamer slide shows), ConTeXt, RTF, DocBook XML, OpenDocument XML,
ODT, Word docx, GNU Texinfo, MediaWiki markup, EPUB, Textile, groff man pages,
Emacs Org-Mode, AsciiDoc, and Slidy, Slideous, DZSlides, or S5 HTML slide shows.
It can also  pro‐ duce PDF output on systems where LaTeX is installed.

All documentation changes can be submitted as changes to markdown and we can
attempt a periodic documentation refresh on gluster.org.

Change-Id: I5dcf7f79184cd6b6d62ce7065d2faa352622f6ac
Reviewed-on: http://review.gluster.org/5232
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Tested-by: Anand Avati <avati@redhat.com>
build: sync glusterfs.spec.in with Fedora glusterfs.spec

 * add glusterfs-api and glusterfs-api-devel sub-packages
 * add extras/systemd/glusterd.service. Use it (or extras/init.d/glusterd)
   instead of the Fedora versions.
 * restores ability to build glusterfs RPMs from the dist tarball with
   'rpmbuild {-ts,-tb,-ta} glusterfs-XXX.tar.gz'
 * other minor cleanups mostly to sync with fedora .spec and to build
   from the dist tarball. Any differences will be resolved in the fedora
   .spec in the next release (i.e. beta4 or GA).

(still considering whether to add fedora glusterfsd.{init,service} files
to glusterfs or remove them from fedora.)

BUG: 950083
Change-Id: Ibda3cd57b24ef5c2a27446703e718e5044ec546c
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Reviewed-on: http://review.gluster.org/5230
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Bala FA <barumuga@redhat.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
rpm: move the mount/api xlator to the glusterfs-api sub-package

The main glusterfs package included the xlator/api.so file which caused
a dependency on the glusterfs-api package:

  # rpm -i glusterfs-3.4.0-0.6.beta3.el6.x86_64.rpm
  error: Failed dependencies:
  libgfapi.so.0()(64bit) is needed by glusterfs-3.4.0-0.6.beta3.el6.x86_64

Moving the mount/api xlator to the glusterfs-api package will prevent
the automatic dependency generator to add the dependency to the main
package.

Change-Id: I4650c40cdfe610b9b69bab07d262093854aa6583
BUG: 950083
Reported-by: Vijay Bellur <vbellur@redhat.com>
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/5255
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
nfs/auth: reject mounts if getaddrinfo fails

When nfs.addr-namelookup is turned on, if the
getaddrinfo call fails while authenticating client's
ip/hostname, the mount request is denied

Change-Id: I744f1c6b9c7aae91b9363bba6c6987b42f7f0cc9
BUG: 947055
Signed-off-by: Rajesh Amaravathi <rajesh@redhat.com>
Reviewed-on: http://review.gluster.org/5143
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
build: declare lvm_lv_from_name() if it is missing from lvm2app.h

The bd-xlator can not be built successfully on certain Debian
distributions due to a missing declaration of lvm_lv_from_name(). This
function is available for linking, but it does not exist in the header
file.

This change adds a detection for lvm_lv_from_name() in both the library
for linking, and the declaration in the header file. If the 1st is
missing, the bd-xlator can not be built, and if only the 2nd one is
missing, we'll declare lvm_lv_from_name() ourselves. This makes it
possible to build the bd-xlator on the affected Debian distributions
too.

Change-Id: I0c823a7861b02bb5d9c1abb76ebfff92f272f9eb
BUG: 976946
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/5250
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
protocol/server: Initialize connection variable

Change-Id: I46badd812e9b936911ddd2793cef7ce30ec220a6
BUG: 979237
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/5266
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
cluster/afr: Handle NULL fdctx in fsync

Problem:
If fdctx is NULL in afr_fsync, process crashes because
of NULL dereference.

Fix:
if fdctx is NULL, always say witnessed unstable write so
that fsyncs are done properly. Handled fdctx being null
in afr_delayed_changelog_post_op otherwise fsync stub is
never resumed and the mount was hanging.

Change-Id: Icacc900e9be63c29db3325cb0e19cc250adebaac
BUG: 978794
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/5258
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
nfs: exit when all volumes are disabled

Instead of triggering 4-5 error logs, when nfs is
disabled for all volumes, exit the process.

Change-Id: Ib286f143c4f74ba22f502aca0e7dcd0907db6563
BUG: 976750
Signed-off-by: Rajesh Amaravathi <rajesh@redhat.com>
Reviewed-on: http://review.gluster.org/5245
Reviewed-by: Santosh Pradhan <spradhan@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
build: sync glusterfs.spec.in with Fedora glusterfs.spec

* fix the hardening fix for shlibs
* use %{__sed} macro
* better short ChangeLog
* fix hard-coded path in extras/systemd/glusterd.service in, use @prefix@

Change-Id: I267244b68a97cbcd6f6ab62fc322c78db45023bb
BUG: 950083
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Reviewed-on: http://review.gluster.org/5264
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
extras/hook-scripts: Set of changes for new samba share method.

New method of creating a share of gluster volume
through samba eliminates the requirement of fuse
mount and changes in fstab.

glusterfs vfs plugin has to be specified as required
vfs object.
Path now is relative to the root of gluster volume.
/ signifies complete volume.

Change-Id: I3d80452cd58513ef59d6a816c1ab62ebc3b76a62
BUG: 953694
Signed-off-by: Raghavendra Talur <rtalur@redhat.com>
Reviewed-on: http://review.gluster.org/5247
Reviewed-by: José Rivera <jrivera@redhat.com>
Tested-by: José Rivera <jrivera@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>