api: Set errno before invoking glfs_init_done()

Change-Id: I3f4d3cfaf7078e126881111eb840d854b0b6466d
BUG: 860212
Signed-off-by: Vijay Bellur <vbellur@redhat.com>
Reviewed-on: http://review.gluster.org/5711
Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
rpc: disable root-squash dynamically upon volume set command

Change-Id: I2ba9ca339ffbe07cb74833165a46a941225b623d
BUG: 927616
Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>
Reviewed-on: http://review.gluster.org/4722
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Reviewed-on: http://review.gluster.org/5847
md-cache: invalidate attributes on xattr update

xattr update will result in at least ctime change. So invalidate
attributes in xattr callback.

Change-Id: Ie6e8f2fd9a11c56c27e78bd58c2ff1e1d6edce6e
BUG: 953694
Signed-off-by: Anand Avati <avati@redhat.com>
Reviewed-on: http://review.gluster.org/5641
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Reviewed-on: http://review.gluster.org/5640
nfs: prevent NFS server crash when upgrading from 3.2.x server

After an upgrade the NFS3 filehandle size changed (became smaller),
but when doing a live ugprade the client would send the old handle
(expect ESTALE and do fresh lookup). But when reading the old
handle we were reading it into a structure which was limited to the
size of the new handle, while we should have been reading into a
buffer which is as big as the NFS3 spec permits the handle size to
be. The actor functions declare the structure on the stack. So the
overflow is resulting in a stack corruption.

Change-Id: Ie930875ac9db46b43d1cb8ad1e6d89cdaeded7ca
BUG: 1002385
Signed-off-by: Anand Avati <avati@redhat.com>
Reviewed-on: http://review.gluster.org/5730
Reviewed-by: Rajesh Joseph <rjoseph@redhat.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-on: http://review.gluster.org/5804
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
md-cache: fix xattr caching code in getxattr

Bad condition check, fix it!

Change-Id: I6e047de70f77d7b98b2ca771a467f14a76fd62fe
BUG: 994392
Signed-off-by: Anand Avati <avati@redhat.com>
Reviewed-on: http://review.gluster.org/5513
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Tested-by: Amar Tumballi <amarts@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-on: http://review.gluster.org/5805
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
glusterd.service (systemd), ensure glusterd starts early, (backport BZ 1004795)

Try (emphasis on the try) to ensure that glusterd starts, and in turn
starts glusterfsd before init attempt to mount any gluster (or gluster
NFS) volumes in /etc/fstab.

N.B. Joe Julian says this doesn't fix the problem for him, although it
worked for me in kvm. Lennart Poettering says it should, and we should
file a BZ against systemd if it doesn't. See
https://lists.fedoraproject.org/pipermail/devel/2013-July/185870.html

Change-Id: I6ac329b5130ba5615df570cf151e70d3618a8a63
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
BUG: 1004796
Reviewed-on: http://review.gluster.org/5824
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
mount/fuse: perform lookup() on inodes linked through readdirplus

Some xlators still require lookup() fop to be sent for proper working.
This patch remembers inodes which have been linked through readdiprlus
and makes the resolver send lookups on them.

Also, introduce and use context count for inode table.

Change-Id: Ibe8a04a659539d90dfc794521b51bf2bda017a0b
BUG: 979910
Signed-off-by: Anand Avati <avati@redhat.com>
Reviewed-on: http://review.gluster.org/5267
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-on: http://review.gluster.org/5806
performance/open-behind: use anonymous fd for doing fstat and readv

Change-Id: I61a3c221e0a15736ab6315e2538c03dac27480a5
BUG: 846240
Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>
Reviewed-on: http://review.gluster.org/4483
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Reviewed-on: http://review.gluster.org/5807
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
open-behind: propagate errors from ob_wake_cbk

If opening fd in background fails, then remember the error and
fail all further calls on the fd.

Use the newly introduced call_unwind_error() function from
call-stub cleanup to fail the future calls.

Change-Id: I3b09b7969c98d915abd56590a2777ce833b81813
BUG: 846240
Signed-off-by: Anand Avati <avati@redhat.com>
Reviewed-on: http://review.gluster.org/4521
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
Reviewed-on: http://review.gluster.org/5808
xlator: NULL terminate volume_options struct

Problem:
volume_options struct for open-behind and quick-read xlators
were not NULL terminated.

Fix:
Make them NULL terminated.

Change-Id: I2615a1f15c6e5674030a219a99ddf91596bf346b
BUG: 965995
Signed-off-by: Santosh Kumar Pradhan <spradhan@redhat.com>
Reviewed-on: http://review.gluster.org/5064
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Reviewed-on: http://review.gluster.org/5809
Reviewed-by: Anand Avati <avati@redhat.com>
performance/open-behind: Fix fd-leaks in unlink, rename

Change-Id: Ia8d4bed7ccd316a83c397b53b9c1b1806024f83e
BUG: 991622
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/5493
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Reviewed-on: http://review.gluster.org/5810
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
gluster/CLI: crash upon executing "peer status" command

Problem:
While doing "gluster peer status", cli_cmd_peer_status_cbk() creates
the frame and passes as arg to gf_cli_list_friends() which sets
frame->local to GF_CLI_LIST_PEERS flag (value: 0x1). It expects
gf_cli_list_friends_cbk() [invoked through cli_cmd_submit()] to
reset frame->local to NULL. But if cli_cmd_submit() fails some
where before gf_cli_list_friends_cbk() gets invoked, then the
flag value remains in frame->local and causes a SEGV while
destroying the stack i.e. [CLI_STACK_DESTROY => cli_local_wipe()].

Fix:
In gf_cli_list_friends(), if cli_cmd_submit() fails, then
reset the value of frame->local to NULL.

Change-Id: Ied19f07eaf67e3bd42c75cdc2ff3729b0789e632
BUG: 961691
Signed-off-by: Santosh Kumar Pradhan <spradhan@redhat.com>
Reviewed-on: http://review.gluster.org/4976
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Reviewed-on: http://review.gluster.org/5811
Reviewed-by: Anand Avati <avati@redhat.com>
posix-acl: disable permission checks for fd based ops

Signed-off-by: shishir gowda <sgowda@redhat.com>
Change-Id: I9d49537c2c7b51d5598b80627d61f060aaec8549
BUG: 921437
Reviewed-on: http://review.gluster.org/4671
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-on: http://review.gluster.org/5812
Reviewed-by: Anand Avati <avati@redhat.com>
system/posix-acl: check for the sticky bit of the parent directory

* While creating links, check if there is sticky bit set for the parent
  directory and whether the sticky bit permits the user to create the link.

Change-Id: Ic0d09d9ed579c4eb47462c71602a3a60cc7d3bc1
BUG: 958691
Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>
Reviewed-on: http://review.gluster.org/4934
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Reviewed-on: http://review.gluster.org/5813
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
cli: check for null in is_server_debug_xlator()

Command: gluster volume set <volname> diagnostics.client-log-level trace
Expected output:
"volume set: failed: option log-level trace: 'trace' is not valid
(possible options are DEBUG, WARNING, ERROR, INFO, CRITICAL, NONE,
TRACE.)"
Current output: gluster cli receives a segmentation fault
Fix: check for NULL before calling strstr

Change-Id: If4c7a85a635849a388cf122543e12349c109643c
BUG: 982174
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
Reviewed-on: http://review.gluster.org/5298
Reviewed-by: Kaushal M <kaushal@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-on: http://review.gluster.org/5814
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
performance/io-threads: fix potential use after free crash

do_iot_schedule() enqueues the stub and kicks the worker thread.
The stub is eventually destroyed after it has been resumed and thus
unsafe to access after being enqueued.

Though likely difficult to reproduce in a real deployment, a crash
is reproducible by running a smallfile benchmark on a replica 2
volume on a single vm. Reorder the debug log message prior to the
do_iot_schedule() call to avoid the crash.

BUG: 989579
Change-Id: Ifc6502c02ae455c959a90ff1ca62a690e31ceafb
Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-on: http://review.gluster.org/5418
Reviewed-by: Santosh Pradhan <spradhan@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Reviewed-on: http://review.gluster.org/5815
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
doc: Update bug for replace-brick problems.

Change-Id: I372568d86fe1b043504dd189853e156b2e210b6e
BUG: 825906
Signed-off-by: Vijay Bellur <vbellur@redhat.com>
Reviewed-on: http://review.gluster.org/5579
Reviewed-by: Anand Avati <avati@redhat.com>
tests: call 'cleanup' at the end of each test (backport BZ 983975)

Some tests do not cleanup after themselves. That is bad behaviour and
makes it difficult to run single tests and verify the state of the
system afterwards.

Change-Id: I5cf80a4a996c691e6b82fd9ce9c711951dc26138
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
BUG: 1004756
Reviewed-on: http://review.gluster.org/5821
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
api: glusterfs-api.pc.in use rpath (-Wl,-R...) (backport BZ 1002220)

Change-Id: Ie36d7c3c058c2e738b0fb1ffae116ed43d573474
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
BUG: 1004751
Reviewed-on: http://review.gluster.org/5822
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
doc: Update link in release notes.

Change-Id: If00485b88611f9ce7ab37491000bf7f9e0c8df57
Signed-off-by: Vijay Bellur <vbellur@redhat.com>
Reviewed-on: http://review.gluster.org/5753
Reviewed-by: Anand Avati <avati@redhat.com>
Tested-by: Anand Avati <avati@redhat.com>