libglusterfs/fd: use reallocated memory for intializing new graphs contexts

While setting fd_ctx, if we have to scale the fd contexts, then we get the
xl_count of the new graph and reallocate the memory for contexts so that
it is suffecient for contexts of xlators of both new as well as old graph, and
then initialize the new graph xlator contexts. For that we are considering the
old pointer itself, instead of using newly reallocated pointer.

Change-Id: I32c18cd69c03c771b4a63e5186c65ae658e54e92
BUG: 817461
Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com>
Reviewed-on: http://review.gluster.com/3250
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
get rid of ZR_PATH_MAX

As suggested by Amar Tumballi

Change-Id: Id1cd74fd7530e8c846f3be4a88b1fa301a728cf1
BUG: 764655
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.com/3243
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
mgmt/glusterd: take the statedumps of running bricks if one of the bricks is down

Till now if one of the bricks of the volume is down, then statedump of that
volume (bricks) did not take the statedumps of running bricks.

This patch fixes that issue and cli command will take the statedumps of
running brick processes.

Change-Id: Id9b11905d3d759202e505c2ecfa6ccd5dce6a9ff
BUG: 816884
Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com>
Reviewed-on: http://review.gluster.com/3237
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
rpcsvc: size check before calloc in rpcsvc_handle_disconnect

Change-Id: Ib9e9e28b4fd3d68ebd4b5dcbd0ee4576217b9d4f
BUG: 782761
Signed-off-by: Rajesh Amaravathi <rajesh@redhat.com>
Reviewed-on: http://review.gluster.com/3257
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
glustershd: allow changing of log-level through cli

Change-Id: Ie33ad4f4ffcb025b22801d6beb9b87d8325021a0
BUG: 815903
Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com>
Reviewed-on: http://review.gluster.com/3234
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
extras: Added hook script to help in CTDB setup

Change-Id: Ib43cd3583e791aabc8cc25fe4eea43a620f73d01
BUG: 806996
Signed-off-by: Krishnan Parthasarathi <kp@gluster.com>
Reviewed-on: http://review.gluster.com/3188
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
log cleanup: in setxattr() path

* in posix we log occassionally if errno is ENOTSUP, added a
  suggestion to mount with 'user_xattr' option.

* changed server's *etxattr_cbk to log ENOTSUP in debug level.

* changed client's *etxattr_cbk to log ENOTSUP in debug level.

Change-Id: Icd604050aaa68546011f2c950ecd7883ac6ee820
Signed-off-by: Amar Tumballi <amarts@redhat.com>
BUG: 811957
Reviewed-on: http://review.gluster.com/3140
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
libgluster: Fix counting, synctask state errors

When a synctask is executed in synctask_switchto, if by the time
it goes to check the woken/sleep part a reply already comes and
__wake is called, already running task is going to be put in runq
this generates a false warning "re-running already running task".

If the reply does not come before the woken/sleep check, then the
running task is put in waitq which decrements env->runcount even
when the task is not in runq, this leads to -ve runcount everytime
a task goes from runq->switchto->waitq.

This patch fixes both of them by introducing a new state for the
task called SYNCTASK_SUSPEND just when the task is suspended before
yeild in SYNCOP.

Change-Id: Ib82182cf950f9d85b5656f6243541489a104ca3d
BUG: 816551
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Reviewed-on: http://review.gluster.com/3249
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
cluster/afr: Fix race in nonblocking entrylk

Change-Id: I6d96c1aed4bf08b90b6918e3694c688eccdc2445
BUG: 818578
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Reviewed-on: http://review.gluster.com/3270
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
glusterd: Disallow (re)-using bricks that were part of any volume

Change-Id: I001a67bed1cc3118174a5ddc2f2011e8e48d8ae8
BUG: 812214
Signed-off-by: Krishnan Parthasarathi <kp@gluster.com>
Reviewed-on: http://review.gluster.com/3147
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
protocol: fix memory leak of lk-owner buffer in *lk() calls

Change-Id: I7fb0e1757c5e04b1a2609c9822ac79301808f671
Signed-off-by: Amar Tumballi <amarts@redhat.com>
BUG: 768330
Reviewed-on: http://review.gluster.com/3244
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
RPC: change the AUTH_GLUSTERFS_v2 value to private range

As per RFC5531, the value we were using with AUTH_GLUSTERFS_v2 (6)
is already a standard number for RPCSEC_GSS. Hence having a number
from the free pool for now, till IANA approves a standard number
for GlusterFS RPC itself.

Change-Id: I10ef6f349bccf3cf42fadfa3861c374adae2a808
Signed-off-by: Amar Tumballi <amarts@redhat.com>
BUG: 816148
Reviewed-on: http://review.gluster.com/3230
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Tested-by: Niels de Vos <ndevos@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
cluster/pump: Fixed fd leaks in pump directory traversal logic

Change-Id: Ie54c8c9b19be6824445ada6bbcd4983e90a7c5c4
BUG: 818593
Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com>
Reviewed-on: http://review.gluster.com/3267
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
glusterd: Added glusterd command specific optional args for hooks scripts.

start volume: --first=yes if the volume is the first to be started
              and --first=no otherwise

stop volume: --last=yes if the volume is the last to be stopped
              and --last=no otherwise

set volume: -o key=value ... for every key, value supplied in
            volume set command

Change-Id: Ia8530771f8b9d7424fd1c736cb4c3622b5cabec2
BUG: 806996
Signed-off-by: Krishnan Parthasarathi <kp@gluster.com>
Reviewed-on: http://review.gluster.com/3260
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
cli: fix remove-brick output behavior in failure cases

earlier it was dependant on server sending the dict for knowing
the command. Now it preserves the dictionary in frame->local,
which is used to understand the command.

Change-Id: Ica675b497e466f77878f67792ae96b71f0704d6b
Signed-off-by: Amar Tumballi <amarts@redhat.com>
BUG: 815745
Reviewed-on: http://review.gluster.com/3235
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Shishir Gowda <shishirng@gluster.com>
glusterd/rebalance: Switch off afr self heal in rebalance process.

Self heal if any will be taken care of the self heal daemon.

Change-Id: I4f3c270b6fce250cbdf6f986066f64e7c4b2f29f
BUG: 808977
Signed-off-by: shishir gowda <shishirng@gluster.com>
Reviewed-on: http://review.gluster.com/3263
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
iobuf: option to provide larger size of buffers

provide an option to failover to standard allocation if iobuf of
required size doesn't exists. this can be achieved by keeping an
arena dedicated for all the out of boundary allocations.

Change-Id: I41a2bd7d353dc7bcb2e1a6e4b41735afe9865975
Signed-off-by: Amar Tumballi <amarts@redhat.com>
BUG: 812784
Reviewed-on: http://review.gluster.com/3136
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
stripe: don't send parent pointer in stripe_readdirp_lookup()

Change-Id: I53e28f4046c13ad13c9300990a95480a5c62f180
BUG: 808353
Signed-off-by: shishir gowda <shishirng@gluster.com>
Reviewed-on: http://review.gluster.com/3232
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
extras/hook-scripts: Fixed EXTRA_DIST to explicitly list *.sh files

Change-Id: I48785317b42e37a6e7768c89bdb7ca8ac41220fa
BUG: 806996
Signed-off-by: Krishnan Parthasarathi <kp@gluster.com>
Reviewed-on: http://review.gluster.com/3271
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
self-heald: Don't trigger self-heal always.

- If self-heal is disabled, the crawl is always spawned but immediately
  terminated upon realizing that the self-heal-daemon is disabled. Fixed it.
- If for some reason finding child position fails, it should still spawn timer
  and should keep the timer alive until the position is found to be REMOTE.

Change-Id: I20cc6af93a1ff26f2b837bbf063bbe508b5fdc78
BUG: 810144
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Reviewed-on: http://review.gluster.com/3100
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>