Fix typos, and spacing issues.

Change-Id: I459ba4e87e9bc4f1c373f7abe8701bfa8450253c
BUG: 1045690
Signed-off-by: James Shubin <james@shubin.ca>
Reviewed-on: http://review.gluster.org/6556
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
cluster/afr: avoid race due to afr_is_transaction_running()

Problem:
------------------------------------------
afr_lookup_perform_self_heal() {
        if(afr_is_transaction_running())
                goto out
        else
                afr_launch_self_heal();
}
------------------------------------------

When 2 clients simultaneously access a file in split-brain, one of them
acquires the inode lock and proceeds with afr_launch_self_heal (which
eventually fails and sets "sh-failed" in the callback.)

The second client meanwhile bails out of afr_lookup_perform_self_heal()
because afr_is_transaction_running() returns true due to the lock obtained by
client-1. Consequetly in client-2, "sh-failed" does not get set in the dict,
causing quick-read translator to *not* invalidate the inode, thereby serving
data randomly from one of the bricks.

Fix:
If a possible split-brain is detected on lookup, forcefully traverse the
afr_launch_self_heal() code path in afr_lookup_perform_self_heal().

Change-Id: I316f9f282543533fd3c958e4b63ecada42c2a14f
BUG: 870565
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
Reviewed-on: http://review.gluster.org/6578
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Varun Shastry <vshastry@redhat.com>
bd: Check for capabilities for creating thin lv

Check capabitlies of the volume before trying to create thin LV.

BUG: 1028672

Change-Id: I1375f6f2a7576e223fc5d7cd40315999446db86a
Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com>
Reviewed-on: http://review.gluster.org/6577
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
mount.glusterfs:export PATH environment variable

Problem: spurious warning:
mount -t glusterfs 10.70.7.228:repvol /mnt/fuse_mnt/
WARNING: getfattr not found, certain checks will be skipped..

Fix:
export PATH so that getfattr search succeeds.

Change-Id: Ib19e2899e43a7d763a136b9fbc90823f743597a5
BUG: 1040348
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
Reviewed-on: http://review.gluster.org/6545
Reviewed-by: Harshavardhana <harsha@harshavardhana.net>
Tested-by: Harshavardhana <harsha@harshavardhana.net>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
cli: Fix xml output for volume status

The XML output for volume status was malformed when one of the nodes is
down, leading to outputs like
-------
          <node>
             <node>
               <hostname>NFS Server</hostname>
               <path>localhost</path>
               <peerid>63ca3d2f-8c1f-4b84-b797-b4baddab81fb</peerid>
               <status>1</status>
               <port>2049</port>
               <pid>2130</pid>
             </node>
-----

This was happening because we were starting the <node> element before
determining if node was present, and were not closing it or clearing it
when not finding the node in the dict.

To fix this, the <node> element is only started once a node has been
found in the dict.

Change-Id: I6b6205f14b27a69adb95d85db7b48999aa48d400
BUG: 1046020
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.org/6571
Reviewed-by: Aravinda VK <avishwan@redhat.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
gfapi: Closed the logfile fd and initialize to NULL in glfs_fini

Currently if logfile is closed and other threads call gf_log
after glfs_fini() is executed, it may lead to memory corruption.
Adding gf_log_fini() which closes the logfile and initializes
the logfile to NULL, thus any further logging happens to stderr.
Also added gf_log_globals_fini() which should be filled in the
future to release all the logging resources.

Change-Id: I879163e1a3636e65300d166f782517ee773cab65
BUG: 1030228
Signed-off-by: Poornima G <pgurusid@redhat.com>
Reviewed-on: http://review.gluster.org/6552
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
socket: unix socket connect path can't be greater than UNIX_PATH_MAX characters

Change-Id: I74788b63dd1c14507aa6d65182ea4b87a2e1f389
BUG: 1046308
Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-on: http://review.gluster.org/6589
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijaikumar Mallikarjuna <vmallika@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
build: fix day in the %changelog

This fixes `warnings` during build tests `rpm.t`

Change-Id: I706ceb1a39d046fe26f70f7b1b06f059abd5d3c0
BUG: 1000019
Signed-off-by: Harshavardhana <harsha@harshavardhana.net>
Reviewed-on: http://review.gluster.org/6584
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
protocol/server: Change log message severity

Change-Id: Ia6aaf8a106c26fa7118c86fadb6805d2877bb6ee
BUG: 849630
Signed-off-by: Vijay Bellur <vbellur@redhat.com>
Reviewed-on: http://review.gluster.org/6610
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
test: Modified bug-1037501.t script

Change-Id: I3114009681d49249fe292f94a464efc419c944cb
BUG: 1037501
Signed-off-by: Venkatesh Somyajulu <vsomyaju@redhat.com>
Reviewed-on: http://review.gluster.org/6596
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
features/index: Minor improvement in log message.

Change-Id: Ic4f39785dab5ad64def4c06d7bd2f2dec09e19ab
BUG: 1045690
Signed-off-by: Vijay Bellur <vbellur@redhat.com>
Reviewed-on: http://review.gluster.org/6606
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Updating extras/Ubuntu with latest upstart configs (BUG: 1047007)

Change-Id: Ia769589f6af1d7ca3577185fd4c56eb9f43b3e2e
BUG: 1047007
Signed-off-by: Louis Zuckerman <me@louiszuckerman.com>
Reviewed-on: http://review.gluster.org/6611
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
crypt: On calloc failure follow goto statement

At
--------------------------------------------
1423	if (local->vec.iov_base == NULL) {
--------------------------------------------

This condition being true leads to NULL pointer
to be passed into `memcpy` later at

----------------------------------------------------
1432	memcpy((char *)local->vec.iov_base + copied,
----------------------------------------------------

Avoid this by clean exit through a goto statement with
in the conditional.

Change-Id: I2546b7dd634dc251adae8ca39497c4c3ef520f62
BUG: 1030058
Signed-off-by: Harshavardhana <harsha@harshavardhana.net>
Reviewed-on: http://review.gluster.org/6576
Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
Reviewed-by: Edward Shishkin <edward.shishkin@gmail.com>
Tested-by: Edward Shishkin <edward.shishkin@gmail.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
rpc/server: add anonuid and anongid options for root-squash

Introduce new options to modify the behaviour of server.root-squash.
With server.anonuid and server.anongid the uid/gid can be specified and
the root user (uid=0 and gid=0) will be mapped to the given uid/gid
instead of nfsnobody (uid=65534 and gid=65534).

Many thanks to Vikhyat Umrao for writing the majority of the test-case!

Change-Id: I6379a3d2ef52b9b9707f2f6f0529657580c8d779
BUG: 1043886
CC: Vikhyat Umrao <vumrao@redhat.com>
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/6546
Reviewed-by: Santosh Pradhan <spradhan@redhat.com>
Reviewed-by: Vikhyat Umrao <vumrao@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
mount/fuse: Remove duplicate GET_STATE call

Change-Id: I5716cb0e9914f78489e3422a03efc689f5ebc413
BUG: 952029
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/6579
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
libglusterfs: Add missing goto in eh_new()

Change-Id: I64bbd8d5d919e78286a0521b62ca75f22ad296fa
BUG: 795419
Signed-off-by: Vijay Bellur <vbellur@redhat.com>
Reviewed-on: http://review.gluster.org/6623
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Use linkat() instead of link() for portability sake

POSIX does not says wether link(2) on symlink should link on
symlink itself or on target. Linux use symlink, most other
systems use target. Using linkat(2) allows the behavior to be
specified, so that the behavior is portable.

Also fix configure test for NetBSD linkata(2), which ceased to work.

BUG: 764655
Change-Id: Iccd27ac076b7a74e40dcbaa1c4762fd3ad59da5f
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/6539
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Use linkat() instead of link() for portability sake

POSIX does not says wether link(2) on symlink should link on
symlink itself or on target. Linux use symlink, most other
systems use target. Using linkat(2) allows the behavior to be
specified, so that the behavior is portable.

Also fix configure test for NetBSD linkat(2), which ceased to work.

BUG: 764655
Change-Id: I2633fde3b0828ca8c199e11c827720c513e15852
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/6613
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
glusterd: update volinfo->subvol_count in newly added peers

Update the subvol_count when a peer imports information about the friend
volumes.

Change-Id: Id3884bd5727ff22be7ed87f43a1ec1b5fe34813c
BUG: 1047955
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
Reviewed-on: http://review.gluster.org/6629
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
performance/io-cache: reduce the severity of log-message

During a genuine error condition like network outage, the log grows
with redundant information.

Change-Id: I5a4f2f62da10ef656f14200c4c84a6917b1f0ddd
Signed-off-by: Raghavendra G <rgowdapp@redhat.com>
BUG: 1048084
Reviewed-on: http://review.gluster.org/6635
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>