performance/quick-read: disable reading from cache if unlink has
happened after fd was opened.

If dentry being unlinked is the last one, there is a possibility that
later, a new entry with same name being created. After creation of new
file, we shouldn't be returning the contents of this new file, when
application reads using fd opened before unlink.

Change-Id: Ic98aa9cd76d24e8a37ce02a0aae6c66290043192
BUG: 811976
Signed-off-by: Raghavendra G <raghavendra@gluster.com>
Reviewed-on: http://review.gluster.com/3151
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
glusterd (remove-brick): fix data-loss issue

* when more than one brick (more than one distribute subvolume)
  was removed using single command, rebalance process used to
  get started only on one node, causing data-loss when 'commit'
  was done, because the brick's data was not migrated at all.
  Fixed the logic of validating rebalance required in remove-
  brick case.

Change-Id: I3a90ff9f9593e5215110a3a0974bb97e7271f910
Signed-off-by: Amar Tumballi <amarts@redhat.com>
BUG: 812770
Reviewed-on: http://review.gluster.com/3173
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Shishir Gowda <shishirng@gluster.com>
glusterd/rebalance: Start process with xlator option client-pid -3

This would prevent updation of xtime by the marker.
Set frame->root->pid while creating sync-task. Removing the command
option, as it is in-effective

Change-Id: Ifaa587df67a72ec0571c7d0043de8048e2be12a8
BUG: 812287
Signed-off-by: shishir gowda <shishirng@gluster.com>
Reviewed-on: http://review.gluster.com/3180
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
features/locks: Find parent-entrylk presence in lookup

Change-Id: I8fc85676827f26b07bf578ea1152d3e251adb4af
BUG: 765551
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Reviewed-on: http://review.gluster.com/3177
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
cluster/afr: Build parent loc for expunge

Change-Id: Ifd1a4117924a7f9a90eb8e02dd2d655f2156fabd
BUG: 765551
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Reviewed-on: http://review.gluster.com/3178
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
glusterd: Properly validate compressed form of IPv6 addresses

Properly validate IPv6 compressed notation, when used in volume set.

Change-Id: Ia489125a45472fc0971c6b11de073aaeb9b1a123
BUG: 810442
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.com/3152
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
nfs/nlm: disable NLM if rpc.statd is not found.

Change-Id: I571e1f14cefdfabecd8996b6d0ffc928464d2b51
BUG: 813258
Signed-off-by: Krishna Srinivas <ksriniva@redhat.com>
Reviewed-on: http://review.gluster.com/3174
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
cluster/dht: Remove un-used pathinfo code for link files

Currently, we do not return LINK: attributes for a file
in pathinfo requests.

Change-Id: If8667bd6af06de3d11c37dd0a09726dfe1d2e330
BUG: 795289
Signed-off-by: shishir gowda <shishirng@gluster.com>
Reviewed-on: http://review.gluster.com/3175
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Venky Shankar <vshankar@redhat.com>
cli: do not put the frame->local to mempool since its a calloced structure

In cli, frame->local is not allocated from the internal mempool, rather its
calloced. So while destroying the stack, we have to set frame->local to NULL.
Otherwise if frame->local is not NULL, STACK_DESTROY will try to put it back
to the mempool and thus segfault.

Change-Id: I5bd17d099e16fb8e73f3250cc022008e26e28f50
BUG: 812735
Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com>
Reviewed-on: http://review.gluster.com/3167
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
extras: Added (hook) scripts to start/stop samba on volume start and stop

These are example/helper scripts that demonstrate how one could
leverage the recently added hooks interface in glusterd.
The scripts are in 'beta'.

Change-Id: I7aaf999f3bdfb276ef64e115a57cbdb36c7a896e
BUG: 806996
Signed-off-by: Krishnan Parthasarathi <kp@gluster.com>
Reviewed-on: http://review.gluster.com/3086
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
cluster/afr: Handle transient parent-entry xactions in lookup

This patch addresses the case when the lookup on an entry is performed
while it is being renamed. The lookup can possibly return 2 different
gfids when lookup on one subvol reached before rename and on other
after rename. In such cases the conflicting entry self-heal is
triggered to resolve the issue, but if there are lot entry transactions
going on the parent directory of the entry then the non-blocking
locks could fail resulting in EIO. To avoid this, lookup queries
locks xlator if there are any parent-entrylk on entry's basename.
If afr finds that there are such locks and gfids are differing then
it chooses the file with latest ctime as the iatt of the entry.
This solution is not foolproof, but it decreases the probability of
hitting the EIO. The correct solution is to take blocking locks on
the parent-entry to find out the correct source. Taking blocking
locks in lookup is not good. One stale entry lock can hang the whole
filesystem. So we chose to go with this for now.

Change-Id: Ibebb6c3074f56f80a96893b6bf5b77941e30d400
BUG: 765551
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Reviewed-on: http://review.gluster.com/3179
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
cluster/afr: Set errno correctly in find_fresh_parents failures

Change-Id: I923103a03c1efe38285cd70842ec91b98a3f6bfd
BUG: 765551
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Reviewed-on: http://review.gluster.com/3185
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
rpc-clnt: use the correct xdr_size for getting the iobuf

earlier we used to get the size of rpc_msg from an empty msg, which
was resulting in minimum size allocated for rpc-msg. the correct way
is to fill the required fields in rpc_msg structure and then calculate
the size, and allocate the iobuf.

Change-Id: I3692831b53b8820a36e4562a1fa3d4c3dbdf4f9d
BUG: 813787
Signed-off-by: Amar Tumballi <amarts@redhat.com>
Reviewed-on: http://review.gluster.com/3191
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
glusterd: Moved 'hooks' interface code to glusterd-hooks.*

Change-Id: Ia7c0e37154414bddb05516e11b3cc4e6ae83ff38
BUG: 806996
Signed-off-by: Krishnan Parthasarathi <kp@gluster.com>
Reviewed-on: http://review.gluster.com/3142
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
rpc-transport/socket: Set NODELAY for connect socket

This is essentially a re-introduction of setting TCP_NODELAY
on the connect socket which was erroneously removed as part
of commit 2da18b6

Change-Id: Icc3a8faafce0e63a9dde592a48f22b90a72860d1
BUG: 795635
Signed-off-by: Vijay Bellur <vijay@gluster.com>
Reviewed-on: http://review.gluster.com/3197
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Pranith Kumar Karampuri <pranithk@gluster.com>