syncop: handle 'dataonly' flag in syncop_fsync()

* and also in syncop_readv(), don't look at _cbk args if op_ret
  is < 0.

Change-Id: I3ab2982bc6d186e75b6adb74c8981e4ff7058bbe
Signed-off-by: Amar Tumballi <amarts@redhat.com>
BUG: 839950
Reviewed-on: http://review.gluster.org/3828
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
cli: Proper xml output for "gluster peer status"

Change-Id: I5d72d3844aba0417652498f4dc706b4a68d36bd8
BUG: 847760
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.org/3814
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Krishnan Parthasarathi <krishnan.parthasarathi@gmail.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Self-heald: Prevent logging of errno ENOENT

Change-Id: Ie56228dfbdc7e519a344681487164a835488a470
BUG: 835423
Signed-off-by: Venkatesh Somyajulu <vsomyaju@redhat.com>
Reviewed-on: http://review.gluster.org/3826
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
rpcsvc: remove .vector_actor and related changes

The .vector_actor method of rpcsvc_actor_desc is defunct now after
rpc unification. Remove the field and all related usage of it.

Change-Id: I53048cebeae78f50259e8c4a7fec3497691fe388
BUG: 762935
Signed-off-by: Anand Avati <avati@redhat.com>
Reviewed-on: http://review.gluster.org/3832
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
NetBSD build fix

BUG: 764655
Change-Id: I65009625dfa627e0ca3b7ff2784b778d26ec04b1
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/3837
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
syncop: Added scaling down logic

RCA:
Whenever the self-heald tests are done with more than 16 replicates
The number of sync procs goes to > 2. These threads never die.

Fix:
Added scaling down logic in syncops so that the threads terminate
themselves whenever the extra thread is idle for ~10 minutes.
Minimum number of threads is still 2.

Tests:
Added logs for launching and terminating procs, made timeout to
6 seconds and ran volume-heal in a while loop. After logs say
max number of procs are launched, attached process to gdb and
verified that the number of syncop threads are 16. Stopped
volume-heal and observed the logs for terminating the procs.
Attached gdb to process again to check that the syncop threads
are just 2. Did this 5 times. Things worked fine. Which procs
were terminated was random. No proc structure was erroneously
re-used. Procs never exceeded 16 and were never < 2.

Change-Id: I61dd9c25cc478ac8cbda190bee841a995b93c55c
BUG: 814074
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Reviewed-on: http://review.gluster.org/3195
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
fuse: make background queue length configurable

* also make 'congestion_threshold' an option
* make 'congestion_threshold' as 75% of background queue length if
  not explicitely specified
* in glusterfsd.c, moved all the fuse option dictionary setting
  code to separate function

Change-Id: Ie1680eefaed9377720770a09222282321bd4132e
Signed-off-by: Amar Tumballi <amarts@redhat.com>
BUG: 845214
Reviewed-on: http://review.gluster.org/3830
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
epoll: whitespace cleanup and remove unused variable

Change-Id: Idd7269f8b3a6dfaf931b378128eff93088b3be73
BUG: 821087
Signed-off-by: Anand Avati <avati@redhat.com>
Reviewed-on: http://review.gluster.org/3841
Tested-by: Gluster Build System <jenkins@build.gluster.com>
posix-acl: make use of 'umask' flag passed as argument in fop

* currently "umask" is reffered only from xdata dictionary, instead
  we should utilize fop argument.
* not taking of setting of "umask" in fuse for now, considering the
  backward compatibility with earlier releases.
* dict_del() the "umask" and "mode" keys from xdata dict as the fop
  after reaching posix layer tries to set every entry in xdata as
  xattr on file/dir.

Change-Id: I7199b05a5bde132df20e7812a99bc02ef7b988ce
Signed-off-by: Amar Tumballi <amarts@redhat.com>
BUG: 850873
Reviewed-on: http://review.gluster.org/3843
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
socket: code cleanup

* for more review friendly way

* reduce the level of indirections at each line.

Change-Id: I82ace7683fb281d97a64da724f054ece28215054
Signed-off-by: Amar Tumballi <amarts@redhat.com>
BUG: 764890
Reviewed-on: http://review.gluster.org/3839
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Add support for --enable-debug configure option

Currently default build adds -g -O2 to CFLAGS unconditionally
and there is no way to control them from configure.

This patch adds support for --enable-debug option to the
configure cmdline.

If yes, then only -g is added. If no, then -g -O2 is added.
Build defaults to --enable-debug=no.

Also fixes couple of Makefile.am's which had -g hardcoded.

v2:
   Adds -O0 for debug=yes case.
v3:
   Added bugID while submitting patch

Change-Id: I7505619be6fc683de463a0bd44ba5500b0bedfe1
BUG: 851092
Signed-off-by: Deepak C Shetty <deepakcs@linux.vnet.ibm.com>
Reviewed-on: http://review.gluster.org/3822
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Tested-by: Deepak Shetty <dpkshetty@gmail.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
afr: Avoid excessive logging in self-heal.

- (Excessive) Logging has been very useful as 'bread-crumbs' in
  many a root-cause analyses. This patch aims at avoiding logging when
  the information could be reconstructed using the xattrs, statedump,
  and/or "volume heal" CLI commands.

Change-Id: Iebc6b10ae18f0dd9704bdc6dd03bcfe0f2a09abd
BUG: 844804
Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-on: http://review.gluster.org/3805
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
init.d: Fix init.d on Redhat, so it does not always return 0.

* Installing gluster with puppet, it gives an error if service "hasstatus => true" is used.
* Introduced a $RETVAL variable set to previous command return value.

Change-Id: I186ec59f892f04f25c06478315ca85183cb6232a
BUG: 836007
Signed-off-by: Thomas Oulevey <thomas.oulevey@cern.ch>
Reviewed-on: http://review.gluster.org/3847
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
All: License message change

The license message is changed to
  Copyright (c) 2008-2012 Red Hat, Inc. <http://www.redhat.com>
  This file is part of GlusterFS.

  This file is licensed to you under your choice of the GNU Lesser
  General Public License, version 3 or any later version (LGPLv3 or
  later), or the GNU General Public License, version 2 (GPLv2), in all
  cases as published by the Free Software Foundation.

Change-Id: I07d2b63ed5fbbbd1884f1e74f2dd56013d15b0f4
BUG: 852318
Signed-off-by: Varun Shastry <vshastry@redhat.com>
Reviewed-on: http://review.gluster.org/3858
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
glusterfsd: rpcsvc actors must return success after an attempt to submit reply

rpcsvc attempts to send "error reply" using the req object. If actor has
already performed rpcsvc_submit_generic, then req is destroyed. So if the
actor returned -1 (RPCSVC_ACTOR_ERROR) on failing to submit reply, then req
would be 'free'd' twice and will result in a crash eventually.

Change-Id: I5eae19570202bbe5e154e9cb03390cfeb9b5f223
BUG: 851410
Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-on: http://review.gluster.org/3863
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
glusterd: Fixed incorrect assumptions in rpcsvc actors of glusterd

Change-Id: Iabfcb401de9d658e32433aa1e8c87b329cbd2cf7
BUG: 851109
Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-on: http://review.gluster.org/3864
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
dht/rebalance: set the correct ownership on the dst file.

Currently, the dst file created has root:root ownership, till
migration is completed. During this phase, open fails on the dst
file if uid/gid is non-root.
Setting the dst_file to the correct ownership fixes the issue

Change-Id: Icfec89eb10dc866cdee38dab17695fe21174ef99
BUG: 852361
Signed-off-by: shishir gowda <sgowda@redhat.com>
Reviewed-on: http://review.gluster.org/3861
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>