libglusterfs: fix GF_FREE

Argument-taking macros should be possible to use with
same syntax that of C functions. In particular (assuming
FOO is a single-argument macro),

  FOO(bar)

should break and

  if (cond)
    FOO(bar);
  else
    baz();

should compile.

Change-Id: If852c128a7317dc0dda1c669be7c6af40501e48d
BUG: 762061
Signed-off-by: Csaba Henk <csaba@redhat.com>
Reviewed-on: http://review.gluster.com/2816
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
cli: Add 'exit' command.

Based on request at:
http://community.gluster.org/i/make-cli-understand-command-exit/

Change-Id: I9116236a8c2f7767c88672b8d3d6565906bfc61f
BUG: 797551
Signed-off-by: Vijay Bellur <vijay@gluster.com>
Reviewed-on: http://review.gluster.com/2815
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra Bhat <raghavendrabhat@gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
cli: Fix broken "volume set help/help-xml"

Change-Id: I4e71e67f32ff37cfe23bc77c0e27645ac495a247
BUG: 796040
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.com/2822
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
glusterfsd: unref the dict and free the memory to avoid memleak

Change-Id: Ib7a1f8cbab039fefb73dc35560a035d5688b0e32
BUG: 796186
Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com>
Reviewed-on: http://review.gluster.com/2808
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
mempool: add more counters to understand the usage scenarios properly

current design of mempool is to fallback to standard calloc/free if
all the buffers in pool are exhausted. Understanding more about those
numbers will help us to tune mempool parameters properly over time.

Change-Id: I2c94373186f7c6a486caff2611c2d9df2c37db3c
Signed-off-by: Amar Tumballi <amarts@redhat.com>
BUG: 797730
Reviewed-on: http://review.gluster.com/2804
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaushal M <kaushal@redhat.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
mgmt/glusterd: pass defrag_cmd in rsp dict for volume info

glusterd_import_volinfo used to error out as it was not able
to find the rebalance key in the dict

Change-Id: Ife35a041072a8a978d7595e8381f68e624bd8da3
BUG: 797105
Signed-off-by: shishir gowda <shishirng@gluster.com>
Reviewed-on: http://review.gluster.com/2814
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
locks/glusterd: Fixed clearing of posix locks from failing always.

Change-Id: Ieaf636c6f0d2aa1d001143a2d1433fce85dc8c7a
BUG: 797042
Signed-off-by: Krishnan Parthasarathi <kp@gluster.com>
Reviewed-on: http://review.gluster.com/2812
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
glusterd/mountbroker: fix handling of MEET mountbroker keyword

Change-Id: I5331a17a772e9ef15e132b9f335e5ff9d70735b7
BUG: 765214
Signed-off-by: Csaba Henk <csaba@redhat.com>
Reviewed-on: http://review.gluster.com/2817
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
storage/posix: In lookup check for buf->gfid being NULL

There are few cases where create and lookup race.
Lookup ends up getting a valid struct iatt, but with no gfid set.
We need to check for gfid being 0, and handle it as an error.

Signed-off-by: shishir gowda <shishirng@gluster.com>
Change-Id: I36ae1978b325aff964cbc3b24730c1e993666267
BUG: 797167
Reviewed-on: http://review.gluster.com/2832
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
transport/socket: configuring tcp window-size

Till now, send and recieve buffer window sizes for sockets
were set to a default glusterfs-specific value.
Linux's default window sizes have been found to be better
w.r.t performance, and hence, no more setting it to any
default value.

However, if one wishes, there's the new configuration option:
   network.tcp-window-size <sane_size>
which takes a size value (int or human readable) and will set
the window size of sockets for both clients and servers.
Nfs clients will also be updated with the same.

Change-Id: I841479bbaea791b01086c42f58401ed297ff16ea
BUG: 795635
Signed-off-by: Rajesh Amaravathi <rajesh@redhat.com>
Reviewed-on: http://review.gluster.com/2821
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: Vijay Bellur <vijay@gluster.com>
nfs/doc: corrections

corrections in nfs configuration helpers displayed
with "gluster volume set help".

Change-Id: Iffc0d10eacbaea647270cd875d4cbd5f80333671
BUG: 771876
Signed-off-by: Rajesh Amaravathi <rajesh@redhat.com>
Reviewed-on: http://review.gluster.com/2829
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
protocol/client: send unique key to server during handshake

utilize the graph->id for making the key unique.

Change-Id: I0c1b355aa901af88e65fd12cb9e0535318856867
BUG: 783982
Signed-off-by: Amar Tumballi <amarts@redhat.com>
Reviewed-on: http://review.gluster.com/2831
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Mohammed Junaid <junaid@redhat.com>
libglusterfs: Handle loc_copy for nameless loc

BUG: 787671
Change-Id: I7601f482ae753ead83be16d1df33c2187e76dc5c
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Reviewed-on: http://review.gluster.com/2825
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
nfs: prevent crash during cthon lock test

When cthon was invoked to test nlm, the mount point
would hang, and crash nfs server, and all the brick
processes. This path fixes the crashes.

Change-Id: Ide88adb7e25ea722b143bfd62e23361ff7be4b67
BUG: 798194
Signed-off-by: Rajesh Amaravathi <rajesh@redhat.com>
Reviewed-on: http://review.gluster.com/2842
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
cluster/stripe: Send xattr request in lookup even when type is INVAL

Change-Id: I6f66b5aa39eaa5eadca2a91b1d4e948490f0aa06
BUG: 798161
Signed-off-by: shishir gowda <shishirng@gluster.com>
Reviewed-on: http://review.gluster.com/2837
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
perf/md-cache: hold lock on modification of md_cache structure

as it is possible that multiple fops can alter the content of
md-cache structure from inode-ctx, we need to safe-guard the
issue of corruption due to race conditions.

Change-Id: Iea051f8f6adff7690d6d60f3cf82eda75150b449
Signed-off-by: Amar Tumballi <amarts@redhat.com>
BUG: 798179
Reviewed-on: http://review.gluster.com/2834
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
mgmt/glusterd: do not close the same fd twice

In volfile generation part, if the close on the file stream for
the volfile fails, then we should not again close the same file
stream which may lead to undefined behavior.

Change-Id: Idec00955eea11d5b2ea74574f8d4e53fa80c220a
BUG: 798599
Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com>
Reviewed-on: http://review.gluster.com/2843
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
cluster/rebalance: Fix expression in check_free_space

Migration should fail if available space in dst < src

The expression was evaluating otherwise

Change-Id: Ief64ad8797e405d0cdc787eef49bfbf4051dffac
BUG: 798864
Signed-off-by: shishir gowda <shishirng@gluster.com>
Reviewed-on: http://review.gluster.com/2847
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
glusterd: Changed clear-locks cmd to use trusted-volfile for its internal mount

Change-Id: Iba8add1802832d4fa7082bc6a68eee966ddc508b
BUG: 798127
Signed-off-by: Krishnan Parthasarathi <kp@gluster.com>
Reviewed-on: http://review.gluster.com/2846
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
cluster/afr: Hardlink Self-heal

Change-Id: Iea0b38011edbc7fc9d75a95d1775139a5234e514
BUG: 765391
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Reviewed-on: http://review.gluster.com/2841
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>