nfs/server: Add counters for hard resolution

Change-Id: Id7b26731b750b63d645222dde18cd9fe4ed54018
BUG: 785314
Signed-off-by: Vijay Bellur <vijay@gluster.com>
Reviewed-on: http://review.gluster.com/2745
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
protocol/client: writev(): don't unwind if rpc_submit failed

because rpc_submit does call 'cbk()' from inside if sending fails.
no need to unwind in higher layers

Change-Id: I08611ce742fba7032f68e3fe0f52a78a18a5714e
Signed-off-by: Amar Tumballi <amar@gluster.com>
BUG: 767359
Reviewed-on: http://review.gluster.com/2770
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
geo-rep / syncdaemon: make the timeout for establishing the connection to slave configurable

It can be set through the connection-timeout tunable but we keep it hidden,
intended as a workaround for some special scenarios not for general use.

Change-Id: I31f9fa3873afa7babc2106ee34484123a01bdc57
BUG: 789078
Signed-off-by: Csaba Henk <csaba@redhat.com>
Reviewed-on: http://review.gluster.com/2840
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
Refactor xlator/lib for better readability & maintainability.

Change-Id: I26532f1bf7cab58b5870a6117f2a62288ee1f23d
BUG: 789078
Signed-off-by: Vijay Bellur <vijay@gluster.com>
Reviewed-on: http://review.gluster.com/2859
Reviewed-by: Pranith Kumar Karampuri <pranithk@gluster.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
xlator/lib: Drain out sent requests to avoid multiple STACK_UNWINDs

Change-Id: Id48c468934ac64ec52e279ded8949c2a7a760598
BUG: 789078
Signed-off-by: Vijay Bellur <vijay@gluster.com>
Reviewed-on: http://review.gluster.com/2871
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Venky Shankar <vshankar@redhat.com>
gsyncd: geo-rep: Reduce excessive verbosity in logging

Backport logging enhancement from master. This patch
reduces per-second logging to per-minute logging during
crawl

Change-Id: Ie51207e6dd8a0257e59f90239cc6960803673223
BUG: 789078
Signed-off-by: Venky Shankar <vshankar@redhat.com>
Reviewed-on: http://review.gluster.com/2879
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
geo-rep / gsyncd: fix cleanup of temporary mounts

The "finally" clause that was meant to cleanup after the
temp mount has not covered the case of getting signalled
(eg. by monitor, upon worker timing out).

So here we "outsource" the cleanup to an ephemeral child process.
Child calls setsid(2) so it won't be bothered by internal process
management. We use a pipe in between worker and the cleanup child;
when child sees the worker end getting closed, it performs the cleanup.
Worker end can get closed either because worker closes it (normal case),
or because worker has terminated (faulty case) -- thus as bonus, we get
a nice uniform handling with no need to differentiate between normal and
faulty cases.

The faulty case that was seen IRL -- ie., users of maintainance mounts
hang in chdir(2) to mount point -- can be simulated for testing purposes
by applying the following patch:

diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c
index acd3c68..1ce5dc1 100644
--- a/xlators/mount/fuse/src/fuse-bridge.c
+++ b/xlators/mount/fuse/src/fuse-bridge.c
@@ -2918,7 +2918,7 @@ fuse_init (xlator_t *this, fuse_in_header_t *finh, void *msg)
         if (fini->minor < 9)
                 *priv->msg0_len_p = sizeof(*finh) + FUSE_COMPAT_WRITE_IN_SIZE;
 #endif
-        ret = send_fuse_obj (this, finh, &fino);
+        ret = priv->client_pid_set ? 0 : send_fuse_obj (this, finh, &fino);
         if (ret == 0)
                 gf_log ("glusterfs-fuse", GF_LOG_INFO,
                         "FUSE inited with protocol versions:"

Change-Id: I1172bf16ac1006bad48958655572155820e5138d
BUG: 786291
Signed-off-by: Csaba Henk <csaba@redhat.com>
Reviewed-on: http://review.gluster.com/2908
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Venky Shankar <vshankar@redhat.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
cluster/afr: Handle split-brain/all-fool xattrs for directory

In case of split-brain/all-fool xattrs perform conservative merge.
Don't treat ignorant subvol as fool.

Change-Id: I3044d388d816d79268fec170d202ef23e7d5bf1c
BUG: 765528
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Reviewed-on: http://review.gluster.com/2674
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
replicate: backport of 0783ca994d9ea95fd9ab3dd95d6407918f19f255

This is a backport of patch 0783ca994d9ea95fd9ab3dd95d6407918f19f255
which is a fix for bug 798874

Change-Id: I0edac430b2f22dce121ff4889b563cbef14b09cd
BUG: 798874
Reviewed-on: http://review.gluster.com/2928
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
cluster/afr: Mark zero size file as sink in absense of xattrs.

Change-Id: Ic9381f9caa7021a629afb7401e51a29686880bfe
BUG: 802637
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Reviewed-on: http://review.gluster.com/2931
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
cluster/afr: Handle files w.o. xattrs and size mismatch.

Change-Id: I31458538c738c85a026994584c937c99538fe069
BUG: 802637
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Reviewed-on: http://review.gluster.com/2932
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
cluster/afr: Perform conservative merge on dir with xattr split-brain

Change-Id: I314cf7bbc8a451e42b6addf367f55e431ab0a85c
BUG: 802637
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Reviewed-on: http://review.gluster.com/2945
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
nfs/server: allow deletion of files by default

this is needed for Micrsoft Windows-based Nfs clients
which do not ignore ACCESS3_DELETE permission not being
granted, while linux/unix systems ignore the same.
behaviour on linux/unix systems remains unchanged

Change-Id: I5d0057548735af542bc3c837b8e2d98c7b0716fa
BUG: 790781
Signed-off-by: Rajesh Amaravathi <rajesh@redhat.com>
Reviewed-on: http://review.gluster.com/2872
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Krishna Srinivas <krishna@gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
libglusterfs: Destroy stack_lock in STACK_DESTROY

Change-Id: Icf910a899db136061a439a2e5e0951da55b92c00
BUG: 798907
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Reviewed-on: http://review.gluster.com/2902
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
mount/fuse: Inherit direct-io-mode values from fds already opened, for a new fd being opened.

When an fd is being opened, it inherits direct-io-mode characterstics
(either enabled or disabled) from the fds already opened on inode. If none
are opened and user has not specified the mode through cmdline options,
default mode is used.

Change-Id: I0c9e959100e9130e46bbd16d63eca278260635b4
BUG: 801
Signed-off-by: Raghavendra G <raghavendra@gluster.com>
Reviewed-on: http://review.gluster.com/20
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Csaba Henk <csaba@redhat.com>
nfs: If entry is not found return ENOENT instead of entering an infinite loop.

Change-Id: I06d471cb996e18fb656a6470de38d2401d846318
BUG: 772542
Signed-off-by: krishna <ksriniva@redhat.com>
Reviewed-on: http://review.gluster.com/2793
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>