mount/fuse: Remove duplicate GET_STATE call

Change-Id: I5716cb0e9914f78489e3422a03efc689f5ebc413
BUG: 952029
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/6579
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
libglusterfs: Add missing goto in eh_new()

Change-Id: I64bbd8d5d919e78286a0521b62ca75f22ad296fa
BUG: 795419
Signed-off-by: Vijay Bellur <vbellur@redhat.com>
Reviewed-on: http://review.gluster.org/6623
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Use linkat() instead of link() for portability sake

POSIX does not says wether link(2) on symlink should link on
symlink itself or on target. Linux use symlink, most other
systems use target. Using linkat(2) allows the behavior to be
specified, so that the behavior is portable.

Also fix configure test for NetBSD linkata(2), which ceased to work.

BUG: 764655
Change-Id: Iccd27ac076b7a74e40dcbaa1c4762fd3ad59da5f
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/6539
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Use linkat() instead of link() for portability sake

POSIX does not says wether link(2) on symlink should link on
symlink itself or on target. Linux use symlink, most other
systems use target. Using linkat(2) allows the behavior to be
specified, so that the behavior is portable.

Also fix configure test for NetBSD linkat(2), which ceased to work.

BUG: 764655
Change-Id: I2633fde3b0828ca8c199e11c827720c513e15852
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/6613
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
glusterd: update volinfo->subvol_count in newly added peers

Update the subvol_count when a peer imports information about the friend
volumes.

Change-Id: Id3884bd5727ff22be7ed87f43a1ec1b5fe34813c
BUG: 1047955
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
Reviewed-on: http://review.gluster.org/6629
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
performance/io-cache: reduce the severity of log-message

During a genuine error condition like network outage, the log grows
with redundant information.

Change-Id: I5a4f2f62da10ef656f14200c4c84a6917b1f0ddd
Signed-off-by: Raghavendra G <rgowdapp@redhat.com>
BUG: 1048084
Reviewed-on: http://review.gluster.org/6635
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
gNFS: Possible SEGV crash in NFS while DRC is OFF

In rpcsvc_submit_generic(), FILE: rpc/rpc-lib/src/rpcsvc.c, while caching
the reply (DRC), the code does not check if DRC is ON and goes ahead
assuming DRC is on and try to take a LOCK on drc.

FIX: Put a check on svc->drc by rpcsvc_need_drc().

Change-Id: I52c57280487e6061c68fd0b784e1cafceb2f3690
BUG: 1048072
Signed-off-by: Santosh Kumar Pradhan <spradhan@redhat.com>
Reviewed-on: http://review.gluster.org/6632
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
gNFS: Small memory leak in rpcsvc_drc_init()

1. The routine rpcsvc_drc_init() is only used while initialization of
NFS xlator. It should just check for nfs.drc option and init DRC feature
accordingly. If it's set to OFF, then rpcsvc_drc_init() allocates memory
for svc.drc and set ret value to 0 and goes to out: block where drc is
leaked.

2. rpcsvc_drc_init() should just allocate svc.drc and init it. Here
svc.drc can never be valid.

3. If svc.drc gets init'd here, no point of checking for drc type here.

Change-Id: I4085771cdb8c9c15d1b9c548b77929a37f27c124
BUG: 1047902
Signed-off-by: Santosh Kumar Pradhan <spradhan@redhat.com>
Reviewed-on: http://review.gluster.org/6628
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Reviewed-by: Rajesh Joseph <rjoseph@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
pathinfo: Provide user namespace access.

Do not allow to setxattr for pathinfo
This change was missed out when submitted patch: http://review.gluster.org/5101/

Change-Id: Ifd32d95089b9bacc5dee80a8b924bb8713dca8a1
Signed-off-by: Vijaykumar M <vmallika@redhat.com>
Reviewed-on: http://review.gluster.org/6535
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Glusterd : glusterd process generates core due to NULL store handle

Problem : glusterd crashed as backtrace revealed that store handle was
set to NULL.

Solution : In glusterd_store_global_info() function out block the
handle is dereferenced with out any NULL check which caused this
segmentation fault. A NULL check is introduced to avoid this. While
testing this fix, another issue was noticed where GF_ASSERT macro again
does not gurantee the NULL dereference check and hence this macro call
has been replaced by GF_VALIDATE_OR_GOTO macro call in places where
there is a danger of macro getting crashed due to NULL dereference
check.

Change-Id: Ic301aa45ce4bbdc2da751d2386439df7bb24c016
BUG: 1040844
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-on: http://review.gluster.org/6619
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Crypt: Fixing incorrect placement of GF_FREE
i.e. we are trying access the memory after freeing it using GF_FREE

Change-Id: I2b22fd421131c618bd0d7c246ebf09f14751ad30
Signed-off-by: Lalatendu Mohanty <lmohanty@redhat.com>
Reviewed-on: http://review.gluster.org/6626
Reviewed-by: Xavier Hernandez <xhernandez@datalab.es>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Add the MAINTAINERS file

Different projects (Linux kernel, QEMU, ...) have a MAINTAINERS file in
the root of the git repository. This file mostly lists the maintainers
or main committers for certain files and directories. On occasion it
would be very helpful to know who to add as a reviewer for proposed
patches.

Change-Id: Ide68779c7477529808ccb0e7d421db160e3222ea
BUG: 1040351
URL: http://lists.nongnu.org/archive/html/gluster-devel/2013-11/msg00045.html
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/6480
Reviewed-by: Amar Tumballi <amarts@gmail.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Lalatendu Mohanty <lmohanty@redhat.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
build: the main glusterfs package should not provide glusterfs-libs

Because of this incorrect provides, there is no requirement to update
glusterfs-libs. Most users will get a newer glusterfs-libs when updating
anyway, but users that manually select RPMs for updating my skip the
package, which will break their system.

Change-Id: I636dfac3f0a521924f1c2e82948bb513b0a5c9f9
BUG: 950083
Fedora-BUG: 1048489
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/6642
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
gNFS: mnt3_find_export() by pass AUTH check

NFS subdir mount does not respect nfs.rpc-auth-reject option
in the volume. If the volume is being mounted, then it would
validate the AUTH by mnt3_check_client_net() but if the client
is mounting a subdir, the control takes a different code path
i.e. mnt3_find_export() which does not bother about the AUTH.

FIX:
Enforce the AUTH check in mnt3_parse_dir_exports() which is
invoked by mnt3_find_export() for subdir mount.

Change-Id: I6fdd3e6bd6cbd32b0d9ca620cc4c30fdaff9ca30
BUG: 1049225
Signed-off-by: Santosh Kumar Pradhan <spradhan@redhat.com>
Reviewed-on: http://review.gluster.org/6655
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
cluster/afr: Don't accept heal commands until graph is up

Change-Id: Icca6c23b6a5965f462db8b65af3eb2e141c7cd39
BUG: 1049355
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/6658
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Ravishankar N <ravishankar@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
cluster/afr: Stop index crawl on pending full crawl

Full crawl is executed when index self-heal is useless, like
disk replacement. So if there are on-going index crawls, they
should be stopped inorder to start full self-heals.

Change-Id: I9a1545f1ec4ad9999dc08523ce859e4fa152e214
BUG: 1049355
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/6659
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Ravishankar N <ravishankar@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
rpc/auth: Avoid NULL dereference in rpcsvc_auth_request_init()

Code section is bogus!
------------------------------------------
370:       if (!auth->authops->request_init)
371:              ret = auth->authops->request_init (req, auth->authprivate);
------------------------------------------

Seems to have been never been used historically since
logically above code has never been true to actually execute
"authops->request_init() --> auth_glusterfs_{v2,}_request_init()"

On top of that under "rpcsvc_request_init()"
verf.flavour and verf.datalen are initialized from what is
provided through 'callmsg'.
------------------------------------------
        req->verf.flavour = rpc_call_verf_flavour (callmsg);
        req->verf.datalen = rpc_call_verf_len (callmsg);

        /* AUTH */
        rpcsvc_auth_request_init (req);
        return req;
------------------------------------------

So the code in 'auth_glusterfs_{v2,}_request_init()'
performing this operation will over-write the original
flavour and datalen.

------------------------------------------
      if (!req)
                return -1;
        memset (req->verf.authdata, 0, GF_MAX_AUTH_BYTES);
        req->verf.datalen = 0;
        req->verf.flavour = AUTH_NULL;
------------------------------------------

Refactoring the whole code into a more understandable version
and also avoiding a potential NULL dereference

Change-Id: I1a430fcb4d26de8de219bd0cb3c46c141649d47d
BUG: 1049735
Signed-off-by: Harshavardhana <harsha@harshavardhana.net>
Reviewed-on: http://review.gluster.org/6591
Reviewed-by: Santosh Pradhan <spradhan@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
geo-rep: Fixing an incorrect memcpy operation.

Currently we are copying a higher size variable to lower size
variable i.e. copying a NAME_MAX  to PATH_MAX sized variable
in "memcpy (sts_val->worker_status, monitor_status, strlen(monitor_status));"

Change-Id: I81dca8e81a4aea5545d5982aed20e05a5e08641c
Signed-off-by: Lalatendu Mohanty <lmohanty@redhat.com>
Reviewed-on: http://review.gluster.org/6667
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
libgfapi : Fixing some NULL pointer dereferencing issues.

1. Fixing dereferencing null pointer "gio"
2. Checking "frame" before calling STACK_DESTROY (frame->root)

Change-Id: If2ce8804a8e9f3f99f71a8c0d13900afb5635072
Signed-off-by: Lalatendu Mohanty <lmohanty@redhat.com>
Reviewed-on: http://review.gluster.org/6313
Reviewed-by: Santosh Pradhan <spradhan@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
Reviewed-by: Raghavendra Talur <rtalur@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
MAINTAINERS: Update BD

BUG: 1040351
Change-Id: I2cbbae22e84fe7f8593db22a32ceb87ca97f46da
Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com>
Reviewed-on: http://review.gluster.org/6679
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Tested-by: Vijay Bellur <vbellur@redhat.com>