features/marker: Filter internal xattrs in lookup

Afr should ignore quota-size-key as part of self-heal
but should heal quota-limit key.

Change-Id: Ic0b06bd20a563a00d6bfdc2dc5a76c661e533ecb
BUG: 1161106
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/9061
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Cluster/DHT : Rebalance skipped file count fix

The return value in dht_migrate_file is used to indicate the status
of the file migration. This value was being masked by the lock operation
causing the skipped and failure file counts to be incorrectly calculated.

Change-Id: Ice3d2f5d57766e18aa52659f22a76867d188dc65
BUG: 1161518
Signed-off-by: Nithya Balachandran <nbalacha@redhat.com>
Reviewed-on: http://review.gluster.org/9070
Reviewed-by: susant palai <spalai@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
extras/hookscripts: Fix set behaviour for user.cifs and user.smb

Setting either of user.cifs or user.smb to disable should disable smb
shares when the smb share is already available.

Change-Id: I213ffca9cedc14107daeb30271d1f41dd9d7fcf4
BUG: 1105147
Signed-off-by: Raghavendra Talur <rtalur@redhat.com>
Reviewed-on: http://review.gluster.org/9042
Reviewed-by: Lalatendu Mohanty <lmohanty@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jose A. Rivera <jarrpa@redhat.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
ec: Correctly handle quota xattrs

Change-Id: I35e11d83c318210d44b918e847cf13db35b01510
BUG: 1158008
Signed-off-by: Xavier Hernandez <xhernandez@datalab.es>
Reviewed-on: http://review.gluster.org/8990
Reviewed-by: Dan Lambright <dlambrig@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
USS : Display only the activated snapshots

Instead of displaying all the snapshots in the uss world,
it is better if we display only the activated snapshots.

Change-Id: I70d3ec212b62ec15956ae3e826bc4201d8dedd17
BUG: 1155042
Signed-off-by: Sachin Pandit <spandit@redhat.com>
Reviewed-on: http://review.gluster.org/8958
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Avra Sengupta <asengupt@redhat.com>
Reviewed-by: Rajesh Joseph <rjoseph@redhat.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
uss/gluster: Move all uss related logs into subfolder

For USS we have 1 snapd log per volume and as many snap logs for volume.
For example if there are 4 volumes having 256 snaps each and USS is
enabled than total number of logs under /var/log/glusterfs for USS would
be 1028 logs.

Total logs = (4(snapd per volume) + 4(volumes)*256(snaps)) = 1028

Hence, it makes sense to move into into sub-folder structure like

/var/log/glusterfs/snaps/<vol-name>/<snapd + snaps logs>

Change-Id: I29262e6458c3906916923cd67d1145d6ae10bec3
BUG: 1160534
Signed-off-by: vmallika <vmallika@redhat.com>
Reviewed-on: http://review.gluster.org/9050
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Rajesh Joseph <rjoseph@redhat.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
glusterd/snapshot: Check if LVM device path exists before delete.

Check if the LV is present before deleting the LV. In case where
the LV is absent (already deleted?), need not fail the snap delete
operation.

Also check if the LV is mounted before trying umount. In case it
isn't umounted, only remove the LV.

Change-Id: I0f5b2674797299d8748c6fac5b091f0caba65ca4
BUG: 1104714
Signed-off-by: Avra Sengupta <asengupt@redhat.com>
Reviewed-on: http://review.gluster.org/8954
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
glusterd/snapshot: Snapshot should be deactivated when it is created

By default snapshot should be deactivated and this should be a
configurable option.

This behaviour can be configured by the command below:
gluster snapshot config activate-on-create <enable|disable>

Change-Id: I1911595c32beed43bb2fca4bf99f0d264b422513
BUG: 1157991
Signed-off-by: vmallika <vmallika@redhat.com>
Reviewed-on: http://review.gluster.org/8985
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Avra Sengupta <asengupt@redhat.com>
Reviewed-by: Rajesh Joseph <rjoseph@redhat.com>
Reviewed-by: Kaushal M <kaushal@redhat.com>
build: fix glupy linking warnings

While building glupy on x86_64, the following warnings are thrown:

  Making all in glupy
  Making all in src
    CC     glupy.lo
    CCLD   glupy.la
  /usr/bin/ld: skipping incompatible /usr/lib/libdl.so when searching for -ldl
  /usr/bin/ld: skipping incompatible /usr/lib/libutil.so when searching for -lutil
  /usr/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
  /usr/bin/ld: skipping incompatible /usr/lib/librt.so when searching for -lrt
  /usr/bin/ld: skipping incompatible /usr/lib/libpthread.so when searching for -lpthread
  /usr/bin/ld: skipping incompatible /usr/lib/libc.so when searching for -lc

The libraries to link against are in /usr/lib64 on x86_64 in Fedora,
RHEL and CentOS. Other architectures or distributions may use a
different path. Instead of hardcoding "/lib" in configure.ac, the
variable $libdir should be used so that the path gets adapted to the
distribution and architecture.

Change-Id: Iae5db3ee8a62959ccb7f958d7c95eb77c4d4b1dd
BUG: 1159248
Reported-by: Kiran Patil <kiran@fractalio.com>
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/9033
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Reviewed-by: Humble Devassy Chirammal <humble.devassy@gmail.com>
test/uss : activate the snapshot after creating.

Till now we were activating the snapshot along with the snapshot create.
But one of the recent patches has changed that behavior. Now we have
to explicitly issue activate-on-create using snapshot config if we
want snapshot to be activated during snapshot create.

Till patch fixes the regression failure which is seen lately.

Change-Id: Ic53b16e22569e521bd70dd3bfa7154a0424151ce
BUG: 1155042
Signed-off-by: Sachin Pandit <spandit@redhat.com>
Reviewed-on: http://review.gluster.org/9113
Reviewed-by: Rajesh Joseph <rjoseph@redhat.com>
Reviewed-by: Meghana M <mmadhusu@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaushal M <kaushal@redhat.com>
uss/gluster: creating file/directories inside .snaps should fail with
EROFS

When an attempt is made to create file/directories inside .snaps, it
fails with wrong error message as "Stale file handle". It should fail
with "Read-only file system"

Change-Id: I3a812a0afc4762cbb71ab180b9394c866e576a66
BUG: 1159840
Signed-off-by: vmallika <vmallika@redhat.com>
Reviewed-on: http://review.gluster.org/9039
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
gNFS: Allow reading ACLs even without read permissions on the file.

When root-squash is enabled or when no permissions are given to
a file, NFS threw permission errors. According to the kernel-nfs
behaviour, no permissions are required to read ACLs.

When no ACLs are set, the system call sys_lgetxattr fails and
returns a ENODATA error. This translates to ESERVERFAULT error
in NFS. Fuse makes an exception to this error and returns a success
case. Similar changes are made here to achieve the expected behaviour.

Change-Id: I46b8f5911114eb087a3f8ca4e921b6b41e83f3b3
BUG: 1161092
Signed-off-by: Meghana Madhusudhan <mmadhusu@redhat.com>
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/9085
Tested-by: Gluster Build System <jenkins@build.gluster.com>
glusterd/snapshot: Don't append nouuid mount option for snapshot brick
if original brick already has this option

Change-Id: I2841d2ac371a3e9505f6061f35d1d447946c0bae
BUG: 1133456
Signed-off-by: vmallika <vmallika@redhat.com>
Reviewed-on: http://review.gluster.org/8526
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
rdma:setting rdma REUSEADDR flag to rdma id.

When we restart the process, it will go TIME_WAIT state to make sure that
all the data in the transport is successfully delivered. REUSEADDR 
allows server to bind to an address which is in TIME_WAIT state.

Change-Id: Ic7deb0d7442c29494fe088598ffe9c87977c04ff
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
Reviewed-on: http://review.gluster.org/9005
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Tested-by: Raghavendra G <rgowdapp@redhat.com>
Build fix: xdrgen

As discovered in https://review.gluster.org/8762, BSD systems fail to
run xdrgen during glusterfs build. This seems to be caused by a
difference between BSD make and GNU make whith implcit targets. The
former seems to use absolute path here, which means we should not
prepend it with the current directory path, otherwise we have the
directory path twice and the files cannot be found my make.

This is a second attempt after I178123bf6f3d9e963ff5b78839d498f530c05a97
which was broken and reverted in I3c8966288f66d0eafa2e94490e3b64a057b4f2c0

BUG: 1157839
Change-Id: I797c536c319a156b71a42c82cbaf80bbf17b7234
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/9046
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Portability fix: mount.glusterfs

Remove bash-specific syntax from mount.glusterfs

BUG: 1129939
Change-Id: Iec3a52686f7cee1825ac5a06c11fb8ac4d3e5d65
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/9044
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Regression test portability: wc

NetBSD wc displays number with leading spaces, which cause arithmeric
operations on values from wc -l to fail.

Fix the problem by defining a wrappers that removes spaces.

BUG: 1129939
Change-Id: I6fa147cf07772f58d9e19e0efd1dae5dad3a4219
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/9076
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
gfapi: Change lookup logic for "/.." and "/." .

We should handle /.. and /. in unique way,
otherwise we may end up setting glusterfs xattrs
on parent of the brick dir.

Change-Id: I206bb1751622bd912bc678fd52f4eddfd9b907c8
BUG: 1128648
Signed-off-by: Raghavendra Talur <rtalur@redhat.com>
Reviewed-on: http://review.gluster.org/8455
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
cli : Maintain separate cli log file per cli instance for cluster regression tests

Change-Id: I7f49f4999d997b99c103fd67d13f972937e3aa92
BUG: 1162987
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-on: http://review.gluster.org/9100
Reviewed-by: Kaushal M <kaushal@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
posix:  Changed order of chown and chmod

    Problem:
    Rebalance process runs in the root mode. If a normal
    user create a file and if it  requires migration then
    because the migrated file is created by root, its owner and
    mode should  be changed to the source normal user and
    permission should be changed the previous mode. If
    the suid bit is also set, then at the destination
    suid bit should also be set.

    Two operations are performed in the given order:
    1. chmod
    2. chown

    But chown resets the suid bit. So changed the order
    of these two operations so that first chown will be
    performed and then chmod will be performd so that
    suid bit will be preserved.

Change-Id: Ib63b5cf528f8336b69bf090ad43bb02eec1d1602
BUG: 1086228
Signed-off-by: Venkatesh Somyajulu <vsomyaju@redhat.com>
Reviewed-on: http://review.gluster.org/7435
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>