Use libglusterfs wrapper to make setxattr portable

BUG: 764655
Change-Id: I332922521bef5684f18d5f7b226cb36d5303ae47
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/6982
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
core: add @xdata parameter to syncop_[f]removexattr()

To be used in afr metadata self-heal

Change-Id: I8dac4b19d61e331702427eeb5b606aab3d20b328
BUG: 1021686
Signed-off-by: Anand Avati <avati@redhat.com>
Reviewed-on: http://review.gluster.org/6941
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
storage/posix: calculate checksum only over read data

If the last block of a file is not aligned to the requested
size, checksum is calculated over junk data in the iobuf. Or
it could be zeroes, resulting in a spurious checksum match
in self-heal.

Change-Id: I41422e08de90013dabfc348ec6fbb8ecdd4f8fb8
BUG: 1021686
Signed-off-by: Anand Avati <avati@redhat.com>
Reviewed-on: http://review.gluster.org/6932
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
syncops: add support for custom PID

AFR self-heal needs to issue syncops with special PID. Extend
the custom UID/GID support to include custom PIDs

Change-Id: I736c0e177f862b029f203acc87f9eb46c8cb839b
BUG: 1021686
Signed-off-by: Anand Avati <avati@redhat.com>
Reviewed-on: http://review.gluster.org/6888
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
Clean up some weirdness with the gf_resolve inet defines

Change-Id: I6bf6101aa0b5d6624891a8ebed2ac1fec2e11e1c
Reviewed-on: http://review.gluster.org/6948
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Removed the old and unused non-Glupy Python bindings code

BUG: 1064096
Change-Id: Ifd34f46f0f0b45bbc27d35953e6ecbca36753886
Signed-off-by: Justin Clift <jclift@redhat.com>
Reviewed-on: http://review.gluster.org/6980
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
add build-gfid option to enable pgfid tracking ...

.. for inode to pathname mapping

Change-Id: I0486d85b02e86d739fc1d8ea16d118fb666abf60
BUG: 1064863
Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-on: http://review.gluster.org/6989
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
glusterd/Vol-Locks : Moving globals into glusterd priv and code refactoring

Moved globals(vol_lock and txn_opinfo dicts and global_txn_id) into
glusterd priv

Moved glusterd_op_send_cli_response() out of gd_unlock_op_phase
as gd_unlock_op_phase and glusterd_clear_txn_opinfo should only
be called if the txn id has been successfully generated. The
cli resp should be sent irrespective of that.

Changed log levels from ERROR to WARNING for some volume lock logs
where the logs are expected and is not an error

Added logs for better transparency of transaction ids.

Change-Id: Ifac9b23aa9f1648c9ae252cfd3ac50bb2ed46728
BUG: 1011470
Signed-off-by: Avra Sengupta <asengupt@redhat.com>
Reviewed-on: http://review.gluster.org/6976
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
glusterfsd: Check for NULL before dereference.

BUG: 789278
CID: 1124805

Change-Id: I5926a4e59790f142d65f034726c9c369c2ad7808
Signed-off-by: Jose A. Rivera <jarrpa@redhat.com>
Reviewed-on: http://review.gluster.org/6909
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
libgfapi: Add proper NULL checks

Two spots check for NULL after the pointer in question has already been
dereferenced. Checked for NULL (and set errno when needed) at appripriate
spots, added a few NULL checks further up the stack, and some whitespace
cleanup.

BUG: 789278
CID: 1124800
CID: 1124805

Change-Id: I1dd4ad3f285cca36f4e3f739288f154ec120aebb
Signed-off-by: Jose A. Rivera <jarrpa@redhat.com>
Reviewed-on: http://review.gluster.org/6908
Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
glusterd: Free dup_value when error path is taken.

When the error path is taken here, the data that was allocated for
dup_value is never freed.  This patch frees it.

Thanks to Kaleb Keithley <kkeithle@redhat.com> for his suggestions on how
to fix this.

Change-Id: Iad88b9ab035602d15961b46c4954d54d54e0d65e
CID: 1124705
BUG: 789278
Signed-off-by: Ira Cooper <ira@samba.org>
Reviewed-on: http://review.gluster.org/6780
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
protocol/client: Fix the possible resource leaks.

Change-Id: Ib86dee366f5a6f0971c6472d1fb2c32dbf7f0102
BUG: 789278
Signed-off-by: Poornima <pgurusid@redhat.com>
Reviewed-on: http://review.gluster.org/6985
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Reviewed-by: Raghavendra Talur <rtalur@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
rpc: Fix a crash due to NULL dereference

Change-Id: Ib2bf6dd564fb7e754d5441c96715b65ad2e21441
BUG: 1065611
Signed-off-by: Vijay Bellur <vbellur@redhat.com>
Reviewed-on: http://review.gluster.org/7007
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
glusterfsd: Use gf_strdup instead of assigning a literal.

Fix for coverity bug CID:1124340

Change-Id: Ibf8700bdeaaddade02e63470a773c5fe2aabc645
BUG: 789278
Signed-off-by: Raghavendra Talur <rtalur@redhat.com>
Reviewed-on: http://review.gluster.org/6984
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
storage/posix:  lgetxattr called with invalid keys on the bricks

More invalid keys have crept in since this was fixed. We need a better
strategy for avoiding this than the current noticed-in-an-strace...

Cleaning tabs while I'm at it.

Change-Id: I2ea97f6d1ab2a9fd569b5b5e01a4de891401fb81
BUG: 765202
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Reviewed-on: http://review.gluster.org/7003
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
protocol/client: conn-id should be unique when lk-heal is off

Problem:
It was observed that in some cases client disconnects
and re-connects before server xlator could detect that a
disconnect happened. So it still uses previous fdtable and ltable.
But it can so happen that in between disconnect and re-connect
an 'unlock' fop may fail because the fds are marked 'bad' in client
xlator upon disconnect. Due to this stale locks remain on the brick
which lead to hangs/self-heals not happening etc.

For the exact bug RCA please look at
https://bugzilla.redhat.com/show_bug.cgi?id=1049932#c0

Fix:
When lk-heal is not enabled make sure connection-id is different for
every setvolume. This will make sure that a previous connection's
resources are not re-used in server xlator.

Change-Id: Id844aaa76dfcf2740db72533bca53c23b2fe5549
BUG: 1049932
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/6669
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
io-cache: Unlock and then goto out in failure case.

Fix for coverity bug CID:1124625

Change-Id: I76df453a17f2af7c48a80b6fc0ccd411ab96e371
BUG: 789278
Signed-off-by: Raghavendra Talur <rtalur@redhat.com>
Reviewed-on: http://review.gluster.org/6949
Reviewed-by: Santosh Pradhan <spradhan@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Docs: Fixed few broken link issues in the doc admin_settingup_clients.md
Signed-off-by: Soumya <skoduri@redhat.com>

Change-Id: If01c1a34aaf6a84b3c95d56a9536b38cd9773cbe
Reviewed-on: http://review.gluster.org/7009
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Tested-by: Vijay Bellur <vbellur@redhat.com>
mount/fuse: Fix the NULL dereference errors reported by coverity.

Change-Id: I9df57e11b115d7323931735c86b586c0b65fa414
BUG: 789278
Signed-off-by: Poornima <pgurusid@redhat.com>
Reviewed-on: http://review.gluster.org/6990
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
libgfapi: In glfs_resolve_at(), do not override the previous return value.

Overriding ret to contain glfs_loc_touchup()s' return value implies that
if glfs_loc_touchup() is successful, glfs_resolve_at() is also successful
which is not necessarily true. This was causing glfs_resolve_at() to
succeed even if it couldn't resolve, thus create and other fops would
fail. Hence overriding ret only if glfs_loc_touchup() fails.

Change-Id: I0804afbd120b3798abe07e870bfc40bf162bc289
BUG: 1066837
Signed-off-by: Poornima G <pgurusid@redhat.com>
Reviewed-on: http://review.gluster.org/7125
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>