NetBSD swapcontext() portability fix

Further analysis of the problem reveals some wrong conclusions I made
before. NetBSD's swapcontext() preempts no thread. It alters the
pthread private pointer, leading to multiple threads with the same
pthread pointer. That led me to the wrong conclusion that thread were
preempted. I guess this can be called a bug: NetBSD swapcontext()
is incompatible with libpthread.

Fortunately, there is a workaround, swapcontext() can be told to
let the pthread private pointer untouched. This change just does
that, fixing the crashes without sacrifying performances.

There is just one problem: not all NetBSD ports have the capability
to do that: at least ports using sh3, sparc, sparc64 and powerpc
are left broken by this change. This problem will be addressed by
upcoming fixes in NetBSD.

BUG: 764655
Change-Id: I4191cb984176fce7064730ab55bd62c9156846cd
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.com/3794
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
cluster/dht: Optimize readdirp calls in DHT

Bring in option which is supported by posix xlator
to filter out directory's entries from being returned.
DHT would now request non-first subvols to filter out
directory entries.

dht xlator-option readdir-optimize will enable this
optimization

Change-Id: I35224bc81c9657f54f952efac02790276c35ded5
BUG: 838199
Signed-off-by: shishir gowda <sgowda@redhat.com>
Reviewed-on: http://review.gluster.com/3772
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
rfc.sh: set 'Change-Id: ' header on first run

Let first run of rfc.sh include 'Change-Id:' as well

Change-Id: I7b45a00d98f8c70ca3658c223a98f412f20cbb6f
BUG: 764890
Signed-off-by: Anand Avati <avati@redhat.com>
Reviewed-on: http://review.gluster.com/3785
Tested-by: Gluster Build System <jenkins@build.gluster.com>
rpc: Reduce frame-timeout for glusterd connections

Reduce frame-timeout for glusterd connections from 30mins to 10 mins. 30mins is
too long when compared to cli timeout of 2mins. Changing to 10mins reduces the
disparity between cli and glusterd.

Also, fix glusterfs_submit_reply() so that a reply is sent even if serialize
failed.

Change-Id: Id5f68f2ff28ea7453d9a62429fe12aa0c0a66952
BUG: 843003
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.com/3803
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
misleading/wrong keep-alive error message in log

Gluster NFS and brick logs contain the following log entries:

[2012-08-16 09:23:39.498998] W [socket.c:410:__socket_keepalive] 0-socket: failed to set keep idle on socket 8
[2012-08-16 09:23:39.499049] W [socket.c:1876:socket_server_event_handler] 0-socket.glusterfsd: Failed to set keep-alive: Operation not supported
[2012-08-16 09:23:42.673756] I [client-handshake.c:1636:select_server_supported_

Stepping through the code though, setting keep-alive did actually work,
it's the keep-idle that failed.

The actual problem is setting keep-idle on non-AF_INET sockets results
in the spurious error message in the log.

BUG: 848882
Change-Id: I3a54c96aea0642307f17a7945cca9f9438543243
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Reviewed-on: http://review.gluster.com/3823
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
fuse: have setxattr on geo-rep related xattrs take effect

In http://review.gluster.com/3687 setxattr was made to a noop for
geo-rep special clients, with the exception of some special ones,
relevant to geo-rep. These exceptions were all in trusted namespace.

That's no good, because with a mountbroker (unprivileged) setup,
the relevant attributes are in system namespace. So here we
just let setxattr through for any geo-rep related xattr, regardless
of namespace.

Change-Id: I261141293b7db955a2e8b2405b4510cb10a42694
BUG: 848447
Signed-off-by: Csaba Henk <csaba@redhat.com>
Reviewed-on: http://review.gluster.com/3821
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Venky Shankar <vshankar@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
fix "--client-pid"

http://review.gluster.com/3698 broke special clients by omitting the
conversion of the client_pid_set parameter to the new xlator option
framework.

Change-Id: I0dc886dffba9c4a9fe8d97e5feccfa5f95784ce1
BUG: 848034
Signed-off-by: Csaba Henk <csaba@redhat.com>
Reviewed-on: http://review.gluster.com/3820
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
cli/: Displaying the size in human readable format

rebalance status displaying the size in bytes. Converted to
human readable

Change-Id: Ie39938970f92bf7507db2a6de4d5958408f3892c
BUG: 825193
Signed-off-by: Varun Shastry <vshastry@redhat.com>
Reviewed-on: http://review.gluster.com/3781
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaushal M <kaushal@redhat.com>
utils: don't leak after failed GF_REALLOC

This is primarily to avoid a leak upon failed GF_REALLOC
when glusterd_readin_file reads a file that is too large.
Also, remove unnecessary memset-0 of PATH_MAX+256-byte buffer.

Change-Id: Id06bd5faef024e1d865f6f0f56bfbb837c9c6168
BUG: 846755
Signed-off-by: Jim Meyering <meyering@redhat.com>
Reviewed-on: http://review.gluster.com/3804
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
gsyncd: don't use void* arithmetic; don't leak upon OOM; remove cast

(duplexpand): Ignore risk of overflow in computation of the realloc
object count, since we'd need a string with 2^62 space-separated tokens
to trigger that (that's w/64-bit size_t; w/32-bit it'd be easier, but
still improbable).

Change-Id: If4521afe7b46110742991dd0ee234284ef8970df
BUG: 846755
Signed-off-by: Jim Meyering <meyering@redhat.com>
Reviewed-on: http://review.gluster.com/3793
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
cluster/dht: don't leak upon GF_REALLOC failure

Change-Id: I7dfabcc2981df5c5a1e1a54c3135400a60626cd1
BUG: 846755
Signed-off-by: Jim Meyering <meyering@redhat.com>
Reviewed-on: http://review.gluster.com/3798
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>