Do not call xdr_string() with a NULL error message

It is illegal to call xdr_string() with a NULL string. Linux
just retruns false, NetBSD gets a SIGSEGV when xdr_string()
calls strlen(NULL)

BUG: 916439
Change-Id: Ia958470ada6e8e55a86d439922ec942d038f5f13
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/4589
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
cluster/distribute: Prevent spurious multiple defrag crawls

In dht_notify, we used to create a thread to start defrag
crawls after we had heard from all child subvols.
This was in-correct, as a later event, could also trigger the
crawl again(due to the fact that all subvols had responded).

The fix is to make sure, the thread is started only once after
all subvols have responded the first time

Change-Id: Ifc2978b9dc866af2395b79911eca50ab38ff9457
BUG: 916449
Signed-off-by: shishir gowda <sgowda@redhat.com>
Reviewed-on: http://review.gluster.org/4587
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
glusterd: Fix some options in vme table

Some of the options had invalid '.flags' members. In the original table
these table these were supposed to be the op-versions, but, the entries
for the below options were missing the flags field the op-version was
entered in that place.

Change-Id: I408f5a972743eb37d9a58a809e8be8cb385bced8
BUG: 903478
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.org/4593
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
glusterd: Added the validation function for subvols-per-directory

Change-Id: Ie2259023b9001311a2032792639c3093054f6750
BUG: 896431
Signed-off-by: Avra Sengupta <asengupt@redhat.com>
Reviewed-on: http://review.gluster.org/4552
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
performance/write-behind: Add test case for fd being marked bad
                          after write failures.

Change-Id: I5a3c27be0ad77b7f2660f45977f9f1f8f34ae31c
BUG: 765473
Signed-off-by: Raghavendra G <raghavendra@gluster.com>
Reviewed-on: http://review.gluster.org/4560
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
libglusterfs: avoid the logging which says the port is invalid

If the reserved ports file in proc contains just a newline, then
do not proceed with ports checking and reserving.

Change-Id: If610b0e49a97e5c22e7e2b1bb4155c9616a4612a
BUG: 762989
Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>
Reviewed-on: http://review.gluster.org/4583
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
cluster/afr: Turn on eager-lock for fd DATA transactions

Problem:
With the present implementation, eager-lock is issued for
any fd fop. eager-lock is being transferred to metadata
transactions. But the lk-owner is set to local->fd address
only for DATA transactions, but for METADATA transactions
it is frame->root. Because of this unlock on the eager-lock fails
and rebalance hangs.

Fix:
Enable eager-lock for fd DATA transactions

Change-Id: If30df7486a0b2f5e4150d3259d1261f81473ce8a
BUG: 916226
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/4588
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Modified validation parameters for owner-uid and owner-gid.

owner-uid and owner-gid will not receive negative values anymore.

Change-Id: I82741d3d01b29e448294b2ec093fb70d22a5c77e
BUG: 912297
Signed-off-by: Avra Sengupta <asengupt@redhat.com>
Reviewed-on: http://review.gluster.org/4581
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
glusterd: Added description for nfs.transport-type option in volume set help.

Change-Id: I9fe81dc1c3172158e8dd86c4fa2a04af18cb9dde
BUG: 782285
Signed-off-by: Avra Sengupta <asengupt@redhat.com>
Reviewed-on: http://review.gluster.org/4582
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
cluster xlators: s/-1/GF_CLIENT_PID_GSYNCD/

Change-Id: I03be3cb23684de4ab36cf2953002708466edd580
BUG: 765433
Signed-off-by: Csaba Henk <csaba@redhat.com>
Reviewed-on: http://review.gluster.org/4601
Reviewed-by: Venky Shankar <vshankar@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
rpm: package /var/run/gluster so that statedumps can be created

Creating statedumps fail when /var/run/gluster does not exist. This
directory should be part of the 'glusterfs' package that is installed on
storage servers and native clients.

BUG: 917561
Change-Id: Ibbc1e4016469fab3db0423337fabc4ba5a8302ab
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/4616
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
nlm: use appropriate open flags while locking

In case of a shared/read lock, open the file in O_RDONLY
mode, and in the case of an exclusive lock, open the file
in O_WRONLY mode to emulate the behaviour posix fcntl
implementation as given in the man pages.

Change-Id: Ib9eab6570c3bc65f8bd48a14a9d801616213b295
BUG: 916930
Signed-off-by: Rajesh Amaravathi <rajesh@redhat.com>
Reviewed-on: http://review.gluster.org/4603
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
iobuf: Added a function iobref_clear

Original-author: Venky Shankar <vshankar@redhat.com>

Change-Id: Ibf861db6c1b084b798d210962344487a1919aad2
Signed-off-by: Prashanth Pai <nullpai@gmail.com>
features/compress: Compression/DeCompression translator

Changes made to original code :
* Changed Makefile.am to reflect changes from commit 58e6296f
* Code to be merged into glusterd-volgen.c moved to
  glusterd-volume-set.c file introduced by commit 99fe09f4
* Added .default_value and .description to xlator options[]
  and removed them from glusterd-volume-set.c
* Moved all cdc xlator specific functions to cdc-helper.c
  retaining only fop implementations in cdc.c
* Changed op_version form 0 to 2 in glusterd-volume-set.c

The following work has been done by Venky Shankar.
Original-author : Venky Shankar <vshankar@redhat.com>

On the server this translator compresses (deflate) data before
it's pushed out to the network to the client. On the client
this compressed data is decompressed (inflate) to it's original
form. What is saved is the amount of data that is sent over
the wire.

(De)Compression is done using Zlib library (inflate/deflate
routines respectively). As of now, data is transferred in
gzip format (header + <compressed data> + trailer). The
header can be taken away to make data more lightweight.
Trailer is needed as it contains the CRC and length of the
original (uncompressed) data used for validating inflated
data.

HOW TO USE
----------
As of now, you'd need to edit the volfile to use this feature;
there is no way to do so from CLI. On the server, load it above
the server translator so that data is compressed just before it
is send out to the network. On the client, load it below the
client translator. But since there can be multiple instances of
the client translator (distribute, replicate etc..), you'd need
to have that many instances of this translator *pointing* to
it's respective client translator.

Change-Id: Ib7a66b6f1f70fe002b7c513588cdf75c69370805
Signed-off-by: Venky Shankar <vshankar@redhat.com>
Signed-off-by: Prashanth Pai <nullpai@gmail.com>
features/compress: Added writev

Writev compresses data on client and decompresses on server.
Similarly readv compresses data on server and decompresses
on client.

The possible values for "mode" option of the cdc xlator
were compress/decompress earlier. This has been changed
after adding writev. Currently the mode option can be
client/server.

Removed gzip header while compressing which was an overhead.
Compressed data is identified by xdata key/value

Other minor changes :
* Check for min file size and buffer size while loading xlator
* Remove cleanup_out label from fop

Change-Id: If4eb4f8af2d63b4bc059e9daaecfda9e1ad8ea56
Signed-off-by: Prashanth Pai <nullpai@gmail.com>
features/compress: Set compression xlator options from CLI

Ex : gluster volume set <vol_name> compress on
     gluster volume set <vol_name> compress.buffer-size 32768

Change-Id: Id30459fd76f7b5155d7b063c36e9caeee4923339
Signed-off-by: Prashanth Pai <nullpai@gmail.com>