mount/fuse: enable fuse real async dio when available

fuse has support for optimized async. direct I/O handling via the
FUSE_ASYNC_DIO init flag. Enable FUSE_ASYNC_DIO when advertised
by fuse.

performance/write-behind: fix dio hang

Also fix a hang observed during aio-stress testing due to conflicting
request handling in write-behind. Overlapping requests are skipped
in pick_winds and may never continue when the conflicting write in
progress returns. Add a wb_process_queue() call after a non-wb request
completes to keep the queue moving.

BUG: 963258
Change-Id: Ifba6e8aba7a7790b288a32067706b75f263105d4
Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-on: http://review.gluster.org/5014
Reviewed-by: Anand Avati <avati@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
tests: basic/rpm.t leaves /var/tmp/rpm-tests.* directories

When the test is terminated early because nothing changed that requires
this test, the /var/tmp/rpm-tests.xxxxxx is not removed.

BUG: 963333
Change-Id: I98d44ca34f14d62da9d836c41a9015cfb520ff96
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Reviewed-on: http://review.gluster.org/5015
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
tests: Ensure portmap registration before nfs mount.

Change-Id: I12a660a7dfbe4a2d0428910d762434043395fe02
BUG: 927616
Signed-off-by: Vijay Bellur <vbellur@redhat.com>
Reviewed-on: http://review.gluster.org/5012
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
syncop: Remove task from synclock's waitq before 'wake'

Removing task from synclock's waitq after wake could result in
a subsequent unlock, wake'ing up the already running task.
This fix makes the removal from waitq and wake 'atomic'.

Change-Id: Ie51ccf9d38f2cee84471097644aab95496f488b1
BUG: 948686
Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-on: http://review.gluster.org/4987
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
glusterd: Start bricks on glusterd startup, only once

The restarting of bricks has been deffered until the cluster 'stabilizes'
itself volumes' view. Since glusterd_spawn_daemons is executed everytime
a peer 'joins' the cluster, it may inadvertently restart bricks that
were taken offline for say, maintenance purposes. This fix avoids that.

Change-Id: Ic2a0a9657eb95c82d03cf5eb893322cf55c44eba
BUG: 960190
Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-on: http://review.gluster.org/4973
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
glusterd: Fix misleading log messages of the kind "Node <n> responded to <n>"

PROBLEM:

glusterd logs coming from glusterd_xfer_friend_add_resp() (wrongly)
indicate that a node responded to itself, although it actually
responded to one of its peers.

FIX:

Make glusterd_xfer_friend_add_resp() distinguish between remote host
and self and print the appropriate hostname.

Change-Id: I2a504eeb058c08a0d378443888eb6f1dc7edc76f
BUG: 963537
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: http://review.gluster.org/5017
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
rpc-transport: Moved unix socket options function to rpc-transport

This change removes the asymmetry in the 'layer' (read rpc, transport
etc) in which transport options were being filled for inet and unix
sockets.

Change-Id: Iaa080691fd5e4c3baedffa97e9c3f16642c1fc12
BUG: 955919
Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-on: http://review.gluster.org/4850
Reviewed-by: Raghavendra G <raghavendra@gluster.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
client: Reset remote-port on first disconnect from brick

Change-Id: I8940358788a7c4f8be81d705749f668a43422b8e
BUG: 962930
Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-on: http://review.gluster.org/4988
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
glusterd: Set op_errstr to error string received from peer

... in case of volume op failure on remote host

Change-Id: I7177dc02369dffa82f217496559532d18b7c7c7a
BUG: 963628
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: http://review.gluster.org/5018
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
cluster/dht: Don't do extra unref in dht-migration checks

Problem:
syncop_open used to perform a ref in syncop_open_cbk so the extra
unref was needed but now syncop_open_cbk does not take a ref so no
need to do extra unref.

Fix:
remove the extra fd_unref and let dht_local_wipe do the final unref.

Change-Id: Ibe8f9a678d456a0c7bff175306068b5cd297ecc4
BUG: 961615
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/4974
Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
locks: fix leaking entrylk lock structure

When entrylk lock requests are blocked and granted aysnchronously,
the entrylk lock structure was getting leaked.

Change-Id: Ie3f29f550730189f27745d991b029e50c63e63da
BUG: 962350
Signed-off-by: Anand Avati <avati@redhat.com>
Reviewed-on: http://review.gluster.org/4991
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
rpc-transport/rdma: use rdma-cm for connection establishment.

Till now gluster used tcp/ip based communication channel with
gluster specific protocol to exchange infiniband addresses.

Change-Id: I9de4db398a0e2af51d3d2d68c2fe42168102b190
BUG: 765051
Signed-off-by: Raghavendra G <raghavendra@gluster.com>
Reviewed-on: http://review.gluster.org/149
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
rpc-transport/rdma: reap async events in a dedicated thread.

* Also sets srq_limit of srq to 10, so that we'll receive an event
  when we are about to empty the receive buffer list.

BUG: 765051
Change-Id: I5436166ea21fc963ee15088fc2df743ec4b96ba7
Signed-off-by: Raghavendra G <raghavendra@gluster.com>
Reviewed-on: http://review.gluster.org/4378
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Tests: changing calls from 'fstat' to 'fstat64' fixes these tests on 32 bit platforms: bug-858242.t, bug-808400*.t

Change-Id: Ifd85c711a8d16eb3ef17bd1c585acdc34121b12d
BUG: 962226
Signed-off-by: John Smith <lbalbalba@gmail.com>
Reviewed-on: http://review.gluster.org/5034
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
configure.ac: enable-debug change breaks _hardened_build

See RHBZ 955283, and http://fedoraproject.org/wiki/Packaging:Guidelines#PIE

The previous change for BZ 851092 in
commit 058a736f9e36238c284ca80e7ed5f62434655019
breaks the ability to enable _hardened_build in release-3.4 and master

BUG: 851092
Change-Id: Ib298a492fee22dd82042af704fe8cdd34c3e100e
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Reviewed-on: http://review.gluster.org/4998
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
configure.ac: build glupy with installed python

IOW with more than just python2.6. Python2.7 is certainly what's on
the vast majority of non-RHEL systems that are out there. Also our
rpm.t regression test will build on epel-5 under mock; RHEL5 has
Python2.4.

Change-Id: I09c95c1fb6b3498e910ad239c4f0af7f786c3700
BUG: 961856
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Reviewed-on: http://review.gluster.org/5007
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
syncop: Update synctask state appropriately

* Earlier, SYNCOP macro, the only consumer of synctask_yield, would set
the task->state to SYNCTASK_SUSPEND. Today, we have glusterd having its
own wrapper macros which don't set task's state. There is also the
syncbarrier and synclock framework, which also participate in a
synctask's scheduling (and need to keep a task's state up to date). It
only makes more sense to leave a synctask's state to the synctask
library, since its an internal affair.

* Need to 'yawn' before 'yield' to avoid re-running tasks to set
  task->woken appropriately.

Change-Id: Ic7a59e6ebcc46f03e53223ca237668d45a3cba40
BUG: 948686
Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-on: http://review.gluster.org/4985
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
tests: Increase wait time for nfs mount.

Change-Id: I61815b502c90314ea6924e3046fb9b396ff56e8b
BUG: 927616
Signed-off-by: Vijay Bellur <vbellur@redhat.com>
Reviewed-on: http://review.gluster.org/5050
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
quick-read: prune cache on write/[f]truncate

Cache needs to be pruned on write and [f]truncate. The lack of this
is causing Samba ping-pong test to return wierd 'data increment' values
during startup.

Change-Id: I9cd6a839bcd02de738d78638211b78f382f58e0a
BUG: 953694
Signed-off-by: Anand Avati <avati@redhat.com>
Reviewed-on: http://review.gluster.org/5033
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
syncop: Remove task from syncbarrier's waitq before 'wake'

Removing task from syncbarrier's waitq after wake could result in a
subsequent syncbarrier_wake, wake'ing up the already running task.  This
fix makes the removal from waitq and wake 'atomic'

The root cause and the fix are similar in spirit to what was observed
in synclock's waitq implementation.

Change-Id: I7dd9e6ad5945742bcda20eb5a06a9376bb18528e
BUG: 948686
Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-on: http://review.gluster.org/5047
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>