Switch to GNU basename_r() and dirname_r()
This is a backport of Change-Id Ic9a159fffdc7bacc9408f8e90854e4c2db81930c
and Id874b9c7aacd9aa3a7a4bd6a92a9633f5b2d6ac0

BUG: 764655
Change-Id: I51aac601fb4cc9a0d87afcab2240dc7a1d131c93
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.com/3576
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
stat(1) flag to specify format is not portable
This is a backport of Change-Id: Iae3c40b03118078530c29d14d5f7180c36361c16

BUG: 764655
Change-Id: Ic4e7adbda6b53b248aa93cd20a045cb885fa818e
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.com/3579
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Set LD_LIBRARY_PATH before starting glusterfs
This is a backport of Change-Id: I13bf0bea043351498b4bc885c5ac45b108229a0a

BUG: 764655
Change-Id: I7908352f7a9baae48a7c3bd2c8845980d0dc9b96
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.com/3578
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Use linkat(2) for symlink to get portable behavior
This is a backport of Change-Id: If7f6f17b48a4ccf8827c3795ec147306df6b5542

BUG: 764655
Change-Id: I374aca5d72d003d67a2bdc9a22b88ce7dd412a0d
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.com/3580
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
NetBSD build fixes
This is a backport of Change-Id: Icd7290f1e340675d763665a0d0c5f95bc14e0c55

BUG: 764655
Change-Id: Iaca3dc30e61c0864af673b90d2a7fdea6a3143cc
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.com/3577
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Use inet as default listene
This is backport of Change-Id: I172570aa58ea08c4c74cfd28f121d3d4e02a55e0

BUG: 764655
Change-Id: I60232b73c303d296e34871ed317925c9af0d322e
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.com/3575
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
cluster/stripe: implement the coalesce stripe file format

The coalesce file format for cluster/stripe condenses the striped
files to a contiguous layout. The elimination of holes in striped
files eliminates space wasted via local filesystem preallocation
heuristics and significantly improves read performance.

Coalesce mode is implemented with a new 'coalesce' xlator option,
which is user-configurable and disabled by default. The format of
newly created files is marked with a new 'stripe-coalesce' xattr.
Cluster/stripe handles/preserves the format of files regardless
of the current mode of operation (i.e., a volume can
simultaneously consist of coalesced and non-coalesced files).
Files without the stripe-coalesce attribute are assumed to have
the traditional format to provide backward compatibility.

extras/stripe-merge: support traditional and coalesce stripe formats

Update the stripe-merge recovery tool to handle the traditional
and coalesced file formats. The format of the file is detected
automatically (and verified) via the stripe-coalesce attributes.

BUG: 801887
Change-Id: I682f0b4e819f496ddb68c9a01c4de4688280fdf8
Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-on: http://review.gluster.com/3639
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
nfs/nlm: statedump of locks

This change allows statedump of nlm locks
giving number of clients, number of locks
each client holds and the files on which lock(s)
is/are held.

Change-Id: I6341c12ec58005ef71b93b316b527e610ff7ee8f
BUG: 824804
Signed-off-by: Rajesh Amaravathi <rajesh@redhat.com>
Reviewed-on: http://review.gluster.com/3492
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Pranith Kumar Karampuri <pranithk@gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
geo-rep / gsyncd: fixes to communication with child processes

due to not using the proper Python keyword, errhandler thread
was possible to run into empty select

Signed-off-by: Csaba Henk <csaba@redhat.com>
BUG: 764678
Change-Id: I3c39e718e72545c27d50fd73aa6daf54062331b0
Reviewed-on: http://review.gluster.com/3562
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
glusterd: Fix peer probe when username/password is missing

Prevent failure of building volumes dictionary during peer probe, when
username/password for a volume is missing. This situation can be caused by
migration of gluster from pre-3.3 to 3.3 and above.

BUG: 834229
Change-Id: I042ecfcc5024e6b18c4ffb44ea0977ec58e22ef8
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.com/3629
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
storage/posix: handle getxattr failures gracefully

Use proper variable types for getting return value of getxattr calls,
which otherwise can lead to segfaulting of processes or page allocation
failures in the kernel.

Change-Id: Idc41b4022401c238d17ba357648234f7c2d56c87
BUG: 838195
Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>
Reviewed-on: http://review.gluster.com/3658
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
cluster/distribute: Suppress user xattr mismatch log message

Changing the log-level to DEBUG.
Xattr mismatch can occur when parallel setxattr's race, or when
one of the bricks was down. A subsequent setxattr will fix the
condition when all the subvols are up. In this case, the 'user.swift'
xattr used by ufo was out of sync, but did not cause any other error.

Change-Id: I6fdff78869b8ff72c305bbe122033e6c1d9d3cff
BUG: 838197
Signed-off-by: shishir gowda <sgowda@redhat.com>
Reviewed-on: http://review.gluster.com/3723
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Mohammed Junaid <junaid@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
glusterd: Set errstr for duplicate add-brick

Sets op_errstr when add-brick is given a duplicate brick.

BUG: 832293
Change-Id: I2d6d13b2ca29615678902b56e6b394ea05f37923
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.com/3585
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
rpc-transport/rdma: decode and handle RDMA_ERROR msgs.

RDMA_ERROR msgs are resulted as part of failure to decode requests
or failure to send reply (for eg., reply being bigger than a msg
that can be sent inline, but client has not provided any write-chunks
to rdma-write into).

Change-Id: I0184cfb5ff8f49ed892767345e32e6c7b01c49e7
BUG: 822337
Signed-off-by: Raghavendra G <raghavendra@gluster.com>
Reviewed-on: http://review.gluster.com/3475
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
cluster/dht: Remove dht dependency on glusterfsd-mgmt

glusterfs_ctx->notify can be used by any xlator to talk to
glusterfsd-mgmt.
Note- This is for any rpc communication initiated by the xlator,
      and not from glusterd.

Change-Id: Ic0e4af106fe1e98d797ca621facda8839b87598a
BUG: 835757
Signed-off-by: shishir gowda <sgowda@redhat.com>
Reviewed-on: http://review.gluster.com/3610
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
rpc: Fixed ping timer algo.

The purpose of the ping timer is to assert the absence of any evidence
the server is possibly alive.

The current implementation updates the 'last_sent' timer in the following
points in time,
- rpc_clnt_submit: when rpc messages are being queued at the transport
  layer. (wrong!, since we have no way to determine if server actually
  received the message)
- rpc_clnt_notify: when client receives pollout event on sending a message
  on the 'wire'. (correct, since it indicates ACK from server)

The fix removes the 'incorrect' update of 'last_sent'.

Change-Id: I56af7b15c3672673696977a7c50ee66eafa4ec55
BUG: 836448
Signed-off-by: Krishnan Parthasarathi <kp@gluster.com>
Reviewed-on: http://review.gluster.com/3624
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
cli: Change cli output for heal commands

BUG: 826406
Change-Id: Ic32c89b92314ee201ec67afc4617e412d4b4c21d
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Reviewed-on: http://review.gluster.com/3636
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
nfs: make NFS filehandles deterministic

The NFS3 file handles now includes just the bare minimum of
(ident, exportid, gfid) and removes legacy 'variable' members
which are unnecessary since the introduction of GFID backend

Change-Id: Iff6e4435d170074b18d208742b48e79b130e2a4d
BUG: 835336
Signed-off-by: Anand Avati <avati@redhat.com>
Reviewed-on: http://review.gluster.com/3617
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
calls to dict_allocate_and_serialize() are not 64-bit clean

All calls to dict_allocate_and_serialize() pass the address of a 32-bit
type, but must cast it to the 64-bit pointer type (size_t *).

This happens to work on LE machines, but even if it's apparently benign,
it's still a bug. On BE machines it is not benign.

GF_PROTOCOL_DICT_SERIALIZE() hacks around it by creating a size_t temp
var, but that's, well, a hack, IMO when you consider that all the callers
are actually passing &<u_int>; the param should just be a u_int * and
eliminate the buggy casts and the temp var in the macro.

Nobody apparently uses the Fedora/EPEL PPC RPMs, but they might. People
are trying to build gluster.org bits on SPARC and tripping over this.

Change-Id: I92ea139f9e3e91ddbbb32a51b96fa582a9515626
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
BUG: 838928
Reviewed-on: http://review.gluster.com/3643
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
cluster/stripe: don't fail if no fctx on a non-regular file

cluster/stripe broke directory rename. Only check for fctx on regular
files.

BUG: 842652
Change-Id: I29d7b265cbe40921226feb3e1c4e6b97b3a01d95
Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-on: http://review.gluster.com/3789
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>