glusterd: Expect setmntent(3) to return NULL

- Closed the mtab FILE * using endmntent(3)

Change-Id: I5e1ebb7f092abda638cfbb5524da693dcac6c872
BUG: 851109
Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-on: http://review.gluster.org/3922
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Add missing contrib/libgen files to distribution
This is a backport of I3f49eb4a1a186cb2d178539ada6a05c8c1aa8265

BUG: 764655
Change-Id: I32264acec0f122d045f369a254df17b488962b9f
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/3884
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Honour configure --localstatedir and --sysconfdir

Makes sure /etc/glusterd to /var/lib/glusterd migration does
nonour configure --localstatedir and --sysconfdir.

Backport of I65a5f96424d67531e81e75b084265bd4e6e30f29

BUG: 764655
Change-Id: I71e0d3b7f0d27b490b591dcc92ddfe26fb8e818d
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/3911
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Detect python > 2.5, make sure MKDIR_P is substituted

gluster build machine generate configure scripts unable to detect python > 2.5
This change include a more recent python.m4 so that newer python can be
correctly detected.

Build.gluster.com also produces a configure that fails to subsitute
MKDIR_P, leading to bugs at make install. Works this around by
introducing mkdirp.m4 from aclocal-1.11, with the autoconf version test
removed because build.gluster.com also has an outdated autoconf. And
we need a bit from a recent autoconf

This is a backport of I3ffac50cc7a10cb9e56dd490dbc2b550bba3fabd

BUG: 764655
Change-Id: I5ceeed957f30af4504701d789931f407b501eeb6
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/3923
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
cli: Added special key "group" for bulk volume set.

gluster volume set VOLNAME group group_name

- where group_name is a file under /var/lib/glusterd/groups containing one
  key, value pair per line as below,
  key1=value1
  key2=value2
  [...]
- the command sets key1 to value1 and so on.

Change-Id: Ic4c8dedb98d013b29a74e57f8ee7c1d3573137d2
BUG: 851237
Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-on: http://review.gluster.org/3896
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
mount.glusterfs NerBSD portability fix

NetBSD stat(1) gets inode using -f %i while Linux uses -c %i
This has already been fixed a few lines above, but one test
failed to be fixed.

This is not based on master, as the code hasbeen reworked a lot,
and is already bug-free.

BUG: 764655
Change-Id: I5dc1196ddba06ff31f695b7dbb0c6d28df32f324
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/3926
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
storage/posix: Option to set brick(of a volume)'s root dir's uid/gid

CLI
---
gluster volume set VOLNAME owner-uid uid
gluster volume set VOLNAME owner-gid gid
where uid,gid are the owner's user id and group id respectively that
would be set on the root of all brick (backend) fs.

TODO: uid/gid should not be -1. Today we don't validate that in CLI.

Change-Id: Ib6a2fb5e404691c5fe105a89faaeff3e1ab72e91
BUG: 853842
Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-on: http://review.gluster.org/3939
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
cli: Fix double free in cli_add_key_group

Change-Id: I3c2f030ac7c53913612a3fbac5e582c47b005621
BUG: 851237
Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-on: http://review.gluster.org/3944
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
glusterd: nfs.disable fix for "volume set help"

Fixes volgen to include "nfs.disable" in output of "volume set help".

Change-Id: Idaac2cee04b7b38aad5a77db558808c0eb699fcf
BUG: 828027
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.org/3881
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
mount.glusterfs: Add support for {attribute,entry}-timeout options

Change-Id: Ib0c9b5be6f05cf9a36271df67e5e5c251c4c4628
BUG: 829279
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.org/3840
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Jeff Darcy <obdurodon@gmail.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
glusterfs SEGV on Fedora 17 from UFO fallocate(2) call

An upload of a file will cause the volume's glusterfs to SEGV
when it fields a FUSE_FALLOCATE op. Swift inspects libc to determine
if there is a symbol for fallocate(2) and if so will use it. And
while the libc in RHEL 6 does have fallocate(2), the version of
fuse in RHEL 6 does not support fallocate, and things are handled
gracefully elsewhere (the kernel perhaps?)

N.B. fallocate was added to version 7.19 of fuse. Fedora 17 and
later (and maybe earlier too) has 7.19. RHEL 6 still has 7.13.
Glusterfs uses the 7.13 version <linux/fuse.h>
(in contrib/fuse-include/fuse_kernel.h)

Thus on Fedora 17, with both fallocate(2) in libc and fallocate
support in fuse, the fallocate invocation is dispatched to glusterfs,
but the dispatch table (fuse_std_ops in
xlators/mount/fuse/src/fuse-bridge.c) is too short for one thing;
the fallocate opcode (43) indexes beyond the end of the table, and
even when that doesn't directly cause a SEGV, the NULL pointer at
that location does cause a SEGV when attempting to call the function
through the pointer.

BUG: 856704
Change-Id: Iffe3994dde6ca29444d07d27eb04d6f86773fa03
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Reviewed-on: http://review.gluster.org/3941
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Mohammed Junaid <junaid@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Fixed some general typing errors.

Eg: changed recieved to received

Change-Id: I360fcb99c97c8a0222e373fee20ea2fccfb938db
BUG: 860543
Signed-off-by: Varun Shastry <vshastry@redhat.com>
Reviewed-on: http://review.gluster.org/3999
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
doc: Update man page for 'gluster' command.

Change-Id: Idb749a4bdde0a07e6919e8007302070fcd6cc67a
BUG: 825906
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.org/3977
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
build: Add glusterd man page packaging in buildspec

Change-Id: Id412a2738b80516bbfc0a9ad7862a45821703c3e
BUG: 825906
Reviewed-on: http://review.gluster.org/4064
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Sachidananda Urs <sacchi@gmail.com>
storage/posix: return -1 if lstat call returns non zero value apart from -1

* If lstat() call in posix_{pstat, istat} returns non zero return value
  other than -1, then treat lstat() call to have been failed and return -1
  itself. This might happen if there is some bug in the backend filesystem.

Change-Id: Ie23787f6c838f14f92edadad71b83471e3d22289
BUG: 864401
Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>
Reviewed-on: http://review.gluster.org/4054
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>