glusterd: Fix stopping of stale rebalance processes

Trying to stop rebalance process via RPC using the GD_SYNCOP macro,
could lead to glusterd crashing. In case of an implicit volume update,
which happens when a peer comes back up, the stop function would be
called in the epoll thread. This would lead to glusterd crashing as the
epoll thread doesn't have synctasks for the GD_SYNCOP macro to make use
of.

Instead of using the RPC method, we now terminate the rebalance process
by kill(). The rebalance process has been designed to be resistant to
interruption, so this will not lead to any data corruption.

Also, when checking for stale rebalance task, make sure that the old
task-id is not null.

Change-Id: I54dd93803954ee55316cc58b5877f38d1ebc40b9
BUG: 1044327
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.org/6531
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
glusterd: ignore failure to stop a stopped service.

kill(2) returns -1 with errno set to ESRCH when the pid of the process
being killed doesn't exist. Failing glusterd_brick_stop on a stopped
brick could result in volume-stop failing, in commit phase.
This fix prevents that from happening.

Change-Id: I00f46fa06e489a671efbb8e4119f545f8ccea329
BUG: 1038051
Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-on: http://review.gluster.org/6525
Reviewed-by: Vijaikumar Mallikarjuna <vmallika@redhat.com>
Reviewed-by: Kaushal M <kaushal@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
glusterd: hold the lock when submitting ACC in replace-brick

replace-brick handler sets the timer to perform the replace operation and unlocks the big_lock.
So we need to lock inside 'glusterd_do_replace_brick' before submitting the ACC

Change-Id: I5525c62533bd92d3ac46587e5353e2443ad85851
BUG: 1044337
Signed-off-by: Vijaykumar M <vmallika@redhat.com>
Reviewed-on: http://review.gluster.org/6534
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
glusterd : enable/disable quota using volume set cmd deprecated.

Using the command 'gluster volume set <volname> quota {on|off}'
doesn't really enable/disable quota. So, a message to the user is
provided. Message asks the user to use 'gluster volume
quota <volname> {enable|disable}' instead.

Improvement of the previous method to solve the issue.

Change-Id: Ibeda35bb49ec7b541d53e592b48fd132380fce76
BUG: 1024626
Signed-off-by: Anuradha Talur <atalur@redhat.com>
Reviewed-on: http://review.gluster.org/6512
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
cluster/afr: For entry self heal, mark all source bricks

Problem:
Whenever a new brick is added into a replicate volume, all
source bricks are not marked as source. Only one of them is
marked as source. Here marked as source refers to adding
extended attribute at the backend of a file corresponding to
the newly added brick. As well as source bricks should point
to the newly added brick so that heal can be triggered.

Fix:
All source bricks will now point to newly added bricks and heal
can be triggered based on the extended attributes.

Change-Id: I318e1f779a380c16c448a2d05c0140d8e4647fd4
BUG: 1037501
Signed-off-by: Venkatesh Somyajulu <vsomyaju@redhat.com>
Reviewed-on: http://review.gluster.org/6540
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>