mgmt/glusterd: native sort of info files

dependence on sort(1) has been removed,
sorting of the files is now done using qsort(3).

Change-Id: I90e162ba626506d01323ddfbfa594cf64b2e43c3
BUG: 790337
Signed-off-by: Rajesh Amaravathi <rajesh@redhat.com>
Reviewed-on: http://review.gluster.com/2990
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
libglusterfs/fd: ref fds while copying the fdentries.

Change-Id: I8973ec5d9858adfbdd6efc7cd596cf5d5af0e3cb
BUG: 767862
Signed-off-by: Raghavendra G <raghavendra@gluster.com>
Reviewed-on: http://review.gluster.com/3006
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
cluster/dht : Acl fix for distribute directory selfheal

Send acl xattrs, if present in the xattrs returned during lookup, during
directory self-heal.

Change-Id: I5337bbd3f3963aeed500a8a552e5f6713089b53e
BUG: 764787
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.com/737
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
glusterd: Fixed replace-brick commit_force algo.

- commit force subcommand of replace-brick (rb) should be allowed
  even if source brick is (irrecoverably) offline.
- modified rb_timer to be active only for start subcommand. This is
  important since, the rb timer event relies on src_brick and dst_brick
  objects to be 'alive' when it 'happens'. In the case of
  abort/commit/commit force it is very likely that src_brick and/or
  dst_brick objects could have been destroyed.

Change-Id: Ib8b8a4d690fbdd6f99b8aff306490eb59c54a437
BUG: 772845
Signed-off-by: Krishnan Parthasarathi <kp@gluster.com>
Reviewed-on: http://review.gluster.com/2620
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
performance/write-behind: queue setattr fop with writes always.

stat returned in setattr_cbk can be cached by the kernel. Hence it is
always necessary that we return correct stat, which implies that setattr
should not be out of order with respect to write fops.

Change-Id: I305feeb4802f8a41ffaf032100832cbd65dfc5c1
BUG: 765443
Signed-off-by: Raghavendra G <raghavendra@gluster.com>
Reviewed-on: http://review.gluster.com/3011
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
protocol/client: Set grace_timer_needed flag to false on a disconnect.

A grace timer is registered on a disconnect, but a reconnect timer sends a
connect request after every 3sec and if the server is down, the client protocol
receives disconnect and a grace timer will be registered which on timeout will
increase the lk-version value. Its enough to register the grace timer once after
the first disconnect and later just ignore other psuedo disconnects until the
next successful reconnect.

Change-Id: I7f34a98a79fdc25370ef15a6712bfa316a9b7c7c
BUG: 807271
Signed-off-by: Mohammed Junaid <junaid@redhat.com>
Reviewed-on: http://review.gluster.com/3020
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
cluster/stripe- do not ref if dict is null

Change-Id: Ifa4a5253482d837e2583de078e908b8c442f9dca
BUG: 807214
Signed-off-by: shylesh kumar <shylesh@gluster.com>
Reviewed-on: http://review.gluster.com/3024
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Shishir Gowda <shishirng@gluster.com>
performance/quick-read: make unlink aware of open-behind behaviour of quick-read.

quick-read should do an open of all the fds that are waiting for to be
opened behind before doing an unlink on a path.

Change-Id: I4c8d65c0511e8a37765ff57e30d99dd89b56c4fc
BUG: 765363
Signed-off-by: Raghavendra G <raghavendra@gluster.com>
Reviewed-on: http://review.gluster.com/506
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Shishir Gowda <shishirng@gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
cluster/afr: Handle afr data self-heal failures gracefully

Change-Id: I5f91098111a8ca29982f3b4292e2109e4a36cce1
BUG: 765373
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Reviewed-on: http://review.gluster.com/2662
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
cli, glusterd: "volume set help" additions

"auth.allow/reject" and "server.statedump" options are included in "volume set
help" now.

Change-Id: I7f9ba89d1782c26792347ffd2cd4042c3c396934
BUG: 783390
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.com/3025
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
build-deploy-jar.py: Print usage message when hadoop home directory is missing.

Change-Id: I0b55b33a36a4a5e4f1b71547629d20ae6b5eba5a
BUG: 807155
Signed-off-by: M S Vishwanath Bhat <vishwanath@gluster.com>
Reviewed-on: http://review.gluster.com/3017
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Venky Shankar <vshankar@redhat.com>
performance/quick-read: fix build errors.

Change-Id: I8c4781bdd6c3cfd50cff95c31ecd6d653b916ac3
BUG: 765363
Signed-off-by: Raghavendra G <raghavendra@gluster.com>
Reviewed-on: http://review.gluster.com/3028
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
cluster/afr: handle fstat failure in data-self-heal

The final fstat which makes the call_count 0 could be a failure.
In that case the buf could either be NULL or buf is all zeros.
If buf is NULL then it will crash, if it is all zeros
buf->ia_type will be IA_INVAL and it proceeds to special file fix.
sh->type is assigned with the ia_type of the file to be healed.
I modified the code to depend on that instead.

Change-Id: Icf7e19ff5908207128f2a1ee2963ad6b791c1ac5
BUG: 804645
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Reviewed-on: http://review.gluster.com/3031
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
cluster/dht: send dict with linkto key for lookup in rmdir_readdirp

Without this, if there are any stale link files, rmdir fails with
ENOEMPTY error.

Change-Id: I7056b272122eb5540c22412856f46f638774c119
BUG: 807246
Signed-off-by: shishir gowda <shishirng@gluster.com>
Reviewed-on: http://review.gluster.com/3035
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
glusterd: Increase output_string size in glusterd_get_volopt_content

The number of volume options with docs has increased, which causes the
output_string to overflow and causes glusterd to crash. This change prevents
glusterd from crashing.

Change-Id: I79f8931f92ad55245aa547e7df15c9826537b615
BUG: 807914
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.com/3030
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
Save old volfiles in the RPM standard way.

I just got bitten by this again.  It appears that the previously merged fix
was inadvertently reverted by a subsequent change.

Change-Id: I3a2067ee891fd5b8be0cd6cee58dcbc8cb6005e9
BUG: 764702
Signed-off-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-on: http://review.gluster.com/3009
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
features/locks: check whether dict is NULL before refing it

Change-Id: I8906b80e584466aceb5a7402e3cee6ac2a552fab
BUG: 808003
Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com>
Reviewed-on: http://review.gluster.com/3036
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
cli,glusterd: more volume status improvements

The major changes are,
* "volume status" now supports getting details of the self-heal daemon processes
for replica volumes. A new cli options "shd", similar to "nfs", has been
introduced for this. "detail", "fd" and "clients" status ops are not supported
for self-heal daemons.
* The default/normal ouput of "volume status" has been enhanced to contain
information about nfs-server and self-heal daemon processes as well. Some tweaks
have been done to the cli output to show appropriate output.

Also, changes have been done to rebalance/remove-brick status, so that hostnames
are displayed instead of uuids.

Change-Id: I3972396dcf72d45e14837fa5f9c7d62410901df8
BUG: 803676
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.com/3016
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Krishnan Parthasarathi <kp@gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
core: fix all the iobuf related refs and unrefs

reviewed the code against all the possible places where
iobuf/iobref ref unref are present, and hopefully fixed most of
the issues around memory leaks with respect to iobuf

Change-Id: I9aa30326962991f8e23acedd389a0e962e097885
Signed-off-by: Amar Tumballi <amarts@redhat.com>
BUG: 797875
Reviewed-on: http://review.gluster.com/2994
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
cli: give warning to user in add-brick if stripe count given

* as it is currently not so well tested, user should get notification
  about possibility of problems with the volume type changes.
* added warning instead of removing the feature because with keeping
  an option we can enhance what is there already.

Change-Id: I6cf3491870ac2e50e85c5dbe15c61622a47c18cb
Signed-off-by: Amar Tumballi <amarts@redhat.com>
BUG: 787967
Reviewed-on: http://review.gluster.com/3034
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>