Commit Graph

11819 Commits

Author SHA1 Message Date
e0df887ba0 storage/posix: Avoid log flood in posix_set_parent_ctime()
posix_set_parent_ctime() unconditionally logs an error if consistent
time attributes is not enabled. This log does not add any value, prints
an incorrect errno & floods the log file.

Hence nuking this log message in this patch.

Change-Id: I82a78f2f8ce5ab518f8cdf6d9086a97049712f75
fixes: bz#1607049
Signed-off-by: Vijay Bellur <vbellur@redhat.com>
2018-07-23 03:57:13 +00:00
d05d4c61e7 geo-rep : fix possible crash
Problem : In 'glusterd_verify_slave' while tokenizing error message
          we call 'strtok_r' and store return value in 'tmp' which
          can be NULL. We are passing this 'tmp' as 1st argument to
          'strcmp' which will lead to segmentation fault.
Solution : before calling 'strcmp' we should NULL check 'tmp'.

Change-Id: Ifd3864b904afe6cd09d9e5a4b55c6d0578e22b9d
fixes: bz#1602121
Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
2018-07-23 03:57:02 +00:00
fd8f712f31 core (named threads): flood of -Wformat-truncation warnings with gcc-7.1
Starting in Fedora 26 which has gcc-7.1.x, -Wformat-trunction is enabled
with -Wformat, resulting in a flood of new warnings. This many warnings
is a concern because it makes it hard(er) to see other warnings that
should be addressed.

An example is at
https://kojipkgs.fedoraproject.org//packages/glusterfs/3.12.0/1.fc28/data/logs/x86_64/build.log

For more info see https://review.gluster.org/#/c/18267/

I can't find much (or good) documentation on the heuristics the
compiler uses for this warning. In the case of printing integer types
it appears it looks at the available space in the destination and the
range of values for the variable and/or its type.

To address the specific question about why 0x3ff versus 0xfff to mask
the value, either would suffice to hint to the compiler that the
printed value will fit in three characters. But the loop is from
0...1023 (or 0...0x3ff if you prefer) so I chose that as a more
"accurate" mask to use as it exactly matches the range of values of
the loop.

Fixes: bz#1492847
Change-Id: I6e309ba42159841131d8241bfc0566ef09e00aa9
2018-07-23 03:01:10 +00:00
621138ce76 All: run codespell on the code and fix issues.
Please review, it's not always just the comments that were fixed.
I've had to revert of course all calls to creat() that were changed
to create() ...

Only compile-tested!

Change-Id: I7d02e82d9766e272a7fd9cc68e51901d69e5aab5
updates: bz#1193929
Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
2018-07-22 14:40:16 +00:00
c0e76377d0 quota: new volume set option to track of quota in GD2
quota enable as volume set needs a new option to keep track of it.

Bugzilla ID:1600812

Change-Id: Ib8d770936bafe859f80e717409bd861760090e59
fixes: bz#1600812
Signed-off-by: Hari Gowtham <hgowtham@redhat.com>
2018-07-21 03:32:53 +00:00
8d7be4ac0c geo-rep: Fix issues with gfid conflict handling
1. MKDIR/RMDIR is recorded on all bricks. So if
   one brick succeeds creating it, other bricks
   should ignore it. But this was not happening.
   The fix rename of directories in hybrid crawl,
   was trying to rename the directory to itself
   and in the process crashing with ENOENT if the
   directory is removed.

2. If file is created, deleted and a directory is
   created with same name, it was failing to sync.
   Again the issue is around the fix for rename
   of directories in hybrid crawl. Fixed the same.

   If the same case was done with hardlink present
   for the file, it was failing. This patch fixes
   that too.

fixes: bz#1598884
Change-Id: I6f3bca44e194e415a3d4de3b9d03cc8976439284
Signed-off-by: Kotresh HR <khiremat@redhat.com>
2018-07-20 12:58:04 +00:00
ea4964df6f glusterd-quota.c: fix coverity warning (BAD_COMPARE)
See https://download.gluster.org/pub/gluster/glusterfs/static-analysis/master/glusterfs-coverity/2018-07-13-1718f9c6/html/1/6glusterd-quota.c.html#error
Only compile tested!

Change-Id: Ief42f9fcdb02ad001bd39c4a6e27e7fa86fd2496
updates: bz#1193929
Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
2018-07-20 12:41:42 +00:00
1ee1666df5 performance/read-ahead: stricter adherence to force-atime-update
Throwaway read-ahead cache in fstat only if force-atime-update is
set. Note that fstat flushes read-ahead cache only for atime
consistency. However if atime consistency is needed user is required
to set force-atime-update which updates atime on backend fs even
though application reads are served from read-ahead cache. So, if user
has not set force-atime-update, atime won't be accurate and there is
no point in flushing read-ahead cache in fstats. mounts
requiring atime consistency have to mandatorily set
force-atime-update.

Also note that normally kernel interspers reads with fstat. So,
read-ahead is not effective as fstats flush read-ahead-cache. Instead
it regresses performance due to wasted network reads. It is
recommended to turn off read-ahead if applications require atime
consistency.

This patch is aimed at applications which don't require atime
consistency. Without atime consistency required, read-ahead cache is
effective and increases performance of sequential reads.

Change-Id: I122bbc410cee96661823f9c4b934383495c18446
Signed-off-by: Raghavendra G <rgowdapp@redhat.com>
Fixes: bz#1601166
2018-07-19 06:56:20 +00:00
1dd71ff8ad extras: Remove the prot_filter.py code
This code was meant to work with the protection xlator which was removed
in Nov 2016. Unfortunately, this file remained and should be removed as
well.

Change-Id: Ia6daa06542ebc8c6fb935c352cc19924f3bb3d8a
Fixes: bz#1598390
Signed-off-by: Nigel Babu <nigelb@redhat.com>
2018-07-19 06:20:32 +00:00
9ab218be5e posix: check before removing stale symlink
BZ 1564071 complains of directories with missing gfid symlinks and
corresponding "Found stale gfid handle" messages in the logs. Hence
add a check to see if the symlink points to an actual directory before
removing it.

Note: Removing stale symlinks was added via commit
3e9a9c029f

Change-Id: I5d91fab8e5f3a621a9ecad4a1f9c898a3c2d346a
Updates: bz#1564071
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
2018-07-19 05:05:55 +00:00
730542a5d8 cluster/dht: Set loc->gfid before healing attr
AFR takes inodelks when setting attrs. The loc->gfid
and loc->inode->gfid were both null when dht_dir_attr_heal
was called during a fresh lookup of an existing directory.
As the gfid is null, client_pre_inodelk asserts in the gfid
check.
We now set the loc->gfid before calling dht_dir_attr_heal.

Change-Id: I457f5a73fd301d97a03ca032587e73d4803298ac
fixes: bz#1602866
Signed-off-by: N Balachandran <nbalacha@redhat.com>
2018-07-18 22:23:07 +05:30
ec0d7d77de afr: switch lk_owner only when pre-op succeeds
Problem:
In a disk full scenario, we take a failure path in afr_transaction_perform_fop()
and go to unlock phase. But we change the lk-owner before that, causing unlock
to fail. When mount issues another fop that takes locks on that file, it hangs.

Fix:
Change lk-owner only when we are about to perform the fop phase.
Also fix the same issue for arbiters when afr_txn_arbitrate_fop() fails the fop.

Also removed the DISK_SPACE_CHECK_AND_GOTO in posix_xattrop. Otherwise truncate
to zero will fail pre-op phase with ENOSPC when the user is actually trying to
freee up space.

Change-Id: Ic4c8a596b4cdf4a7fc189bf00b561113cf114353
fixes: bz#1602236
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
2018-07-18 16:49:56 +00:00
a75a419d39 glusterd: memory leak in get-state
Problem: gluster get-state command is leaking the memory when
geo-replication session is configured.

Cause: In glusterd_print_gsync_status(), we are trying to get
reference to the keys of gsync_dict. The references to keys of
gsync_dict are stored status_vols[i]. status_vols[i] are
allocated with a memory of size of gf_gsync_status_t.

Solution: Need not to use a array of pointers(status_vals), using
a pointer to hold the reference to a key of gsync_dict is sufficient.

Followed the below steps for testing:
1. Configured geo-rep session
2. Ran gluster get-state command for 1000 times.

Without this patch, glusterd's memory was increasing significantly
(around 22000KB per 1000 times), with this patch it reduced (1500KB
per 1000 times)

fixes: bz#1601423
Change-Id: I361f5525d71f821bb345419ccfdc20ca288ca292
Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
2018-07-18 14:08:27 +00:00
e4f6d88752 build/core: location of xattr.h
starting with libattr-devel-2.4.48-1 in Fedora 28 <attr/xattr.h> has
been removed from the package.

On Fedora, RHEL/CentOS, and SUSE, the glibc-headers package has provided
a near identical file, <sys/xattr.h>, in all the releases that we care
about.

On Debian, libc6-dev provides <sys/xattr.h> all the way back to 8/Jessie
and presumably all Ubuntu derivatives since then.

Note that on Debian the sys headers are installed in
/usr/include/$DEB_HOST_GNU_TYPE/sys/...

Change-Id: Id07c4b225bdaa6556bd54772604e75b8f346fb60
updates: bz#1193929
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
2018-07-18 11:05:27 +00:00
c63979fdd8 dht: remove useless argument from dht_iatt_merge
The last using of the subvol argument has been removed at 4e1ec35ef4
("core: fill 'ia_ino' from 'ia_gfid' in 'storage/posix' ......")
7 years ago (2011-06-16).

Change-Id: I9788d79e2e40cc153cf2960e28c7c1c1033dc8f7
fixes: bz#1601683
Signed-off-by: Kinglong Mee <mijinlong@open-fs.com>
2018-07-18 08:16:01 +00:00
6857d80a50 Add the tab space in the list of BROKEN_TESTS environment variable
Fixes: bz#1598325

Change-Id: I4c14514d33288fd33cca903853c6d5e4f70bd441
Signed-off-by: Deepshikha Khandelwal <dkhandel@redhat.com>
2018-07-18 04:10:05 +00:00
de02b57442 dht: delete tier related internal xattr in dht_getxattr_cbk
Use dict_del instead of GF_REMOVE_INTERNAL_XATTR.

For problem and fix related information see here -
https://review.gluster.org/20450.

This patch have some modification as requested by reviewers on already
merged patch :  https://review.gluster.org/20450.

Change-Id: I50c263e3411354bb9c1e028b64b9ebfd755dfe37
fixes: bz#1597563
Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
2018-07-17 18:03:33 +00:00
b9a5d85d15 run-tests.sh: provide option to write 'failure' output to a file
Change-Id: I42f5e0f3513ba758a09b1a7330e49fc3c8fc218e
updates: bz#1600963
Signed-off-by: Amar Tumballi <amarts@redhat.com>
2018-07-17 17:06:58 +00:00
19e646f0b6 core: dereference check on the variables in glusterfs_handle_brick_status
problem: In a race condition, the active->first which is supposed to be filled
is NULL and trying to dereference it crashs.

back trace:
Core was generated by `/usr/sbin/glusterfsd -s bxts470192.eu.rabonet.com --volfile-id prod_xvavol.bxts'.
Program terminated with signal 11, Segmentation fault.
1029            any = active->first;
(gdb) bt

Change-Id: Ia6291865319a9456b8b01a5251be2679c4985b7c
fixes: bz#1600451
Signed-off-by: Hari Gowtham <hgowtham@redhat.com>
2018-07-17 11:12:02 +00:00
475826671a tier: Move time string formatting
There is no need to format the time, unless ret is true.

I don't think there's a reason to allocate memory for
those struct and char array unless we are formatting
either (But I'm not sure what the code convention is - are we
ok with 'local' variable declarations?)

Only compile-tested.

Change-Id: I9feb09871943764bd76bdfc9ac6ca506f329aac1
updates: bz#1193929
Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
2018-07-17 05:42:18 +00:00
c02a25515a glusterd-store: fix coverity warning
The same variable 'len' was used both in the macros and the functions.
(Introduced as part of commit 6dc5dfef81 ?)

Change-Id: If434999d6470067f8a1e501c8e132561e8cd81ef
updates: bz#1193929
Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
2018-07-17 05:41:46 +00:00
42cf8a5f92 testing: Fix the build environment
The build environment for FB is vastly different from us. This change
will match the config to what we use for our regression testing

Change-Id: Ib3584a02dbffb75892f2cbeebcbf51cc3aff3eb6
Fixes: bz#1601390
Signed-off-by: Nigel Babu <nigelb@redhat.com>
2018-07-17 05:27:18 +00:00
762dff25c4 cluster/afr: Mark dirty for entry transactions for quorum failures
Problem:
If an entry creation transaction fails on quprum number of bricks
it might end up setting the pending changelogs on the file itself
on the brick where it got created. But the parent does not have
any entry pending marker set. This will lead to the entry not
getting healed by the self heal daemon automatically.

Fix:
For entry transactions mark dirty on the parent if it fails on
quorum number of bricks, so that the heal can do conservative
merge and entry gets healed by shd.

Change-Id: I56448932dd409b3ddb095e2ae32e037b6157a607
fixes: bz#1586020
Signed-off-by: karthik-us <ksubrahm@redhat.com>
2018-07-16 22:01:34 +05:30
7dd08a4dd0 dht: delete tier related internal xattr in dht_getxattr_cbk
Problem :  Hot and Cold tier brick changelogs report rsync failure

Solution : georep session is failing to sync directory
           from master volume to slave volume due to lot
           of changelog retries, solution would be to ignore tier
           related internal xattrs trusted.tier.fix.layout.complete and
           trusted.tier.tier-dht.commithash in dht_getxattr_cbk.

Change-Id: I3530ffe7c4157584b439486f33ecd82ed8d66aee
fixes: bz#1597563
Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
2018-07-16 05:34:00 +00:00
6c2deb080a logging: check for fmts not being NULL
this fix is just a review of possible SIGSEGV issues in line 714
as per crash report at the bug:

```
08:35:25 Program terminated with signal 11, Segmentation fault.
08:35:25 #0  0x00007f4ebb491c5c in gf_time_fmt (dst=0x7f4eb1ff9a90 "", sz_dst=256, utime=1531470915, fmt=0)
at /home/jenkins/root/workspace/centos7-regression/libglusterfs/src/common-utils.h:714
```

fixes: bz#1600878
Change-Id: I160c391f8ac1a3456e59103d293b24e0e3fae718
Signed-off-by: Amar Tumballi <amarts@redhat.com>
2018-07-16 09:06:27 +05:30
c688bc0197 add check if no matching password record was found with getpwuid_r(uid)
Change-Id: Iae712828ee656008faf5fe2bc4e6f96fa12ea4cb
fixes: bz#1600687
Signed-off-by: Vitaly Lipatov <lav@etersoft.ru>
2018-07-13 13:03:30 +00:00
1718f9c6cb glusterd: To find a compatible brick ignore diagnostics.brick-log-level option
Problem: glusterd start a volume as a separate process instead of
         attaching with the already running process if volume option has
         different brick-log-level. There is no functionality impact on a brick
         if the option has different brick-log-level so glusterd
         should attach a brick with the already running process.

Solution: Ignore brick-log-level option in unsafe_option

BUG: 1599628
Change-Id: I72638ff2026fcd9332bc38e1144b1ef4a708820b
fixes: bz#1599628
Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
2018-07-13 10:22:00 +00:00
e8cf52f510 tests/geo-rep: increase the timeout
since some time, geo-rep tests were in the border of 180-190 seconds to
complete. As actual test timeout is 200 seconds by default, giving
these tests some buffer time to complete properly.

updates: bz#1193929
Change-Id: I9f501a02b52585dff7d0473824bdbb229e124278
Signed-off-by: Amar Tumballi <amarts@redhat.com>
2018-07-13 13:54:00 +05:30
e2c9d0d182 tests/geo-rep: Add rsnapshot and hardlink rename test case
1. rsnapshot creates a I/O pattern which involves
   create, rename, symlink, hardlink in specific
   order.

2. Hardlink rename on master with source unlinked use case

fixes: bz#1597540
Change-Id: Iedade47e5bf9905424a974df6ec33bc6f6695082
Signed-off-by: Kotresh HR <khiremat@redhat.com>
2018-07-13 07:36:24 +00:00
d2fb898e9d Quota: Fix crawling of files
Problem: Running "find ." does not crawl files. It goes over the
directories and lists all dentries with getdents system call.
Hence the files are not looked up.

Solution:
explicitly triggerr stat on files with find . -exec stat {} \;
since crawl can take slightly longer, updating timeout in test case

Change-Id: If3c1fba2ed8e300c9cc08c1b5c1ba93cb8e4d6b6
fixes: bz#1533000
Signed-off-by: Sanoj Unnikrishnan <sunnikri@redhat.com>
2018-07-13 07:34:48 +00:00
271510b09d geo-rep/scheduler: Fix EBUSY trace back
Fix the trace back during temporary mount
cleanup. Temporary mount is done to touch
the root required for checkpoint to complete.

fixes: bz#1598977
Change-Id: I97fea538e92c4ef0747747e981ef98499504e336
Signed-off-by: Kotresh HR <khiremat@redhat.com>
2018-07-12 15:13:42 +00:00
fc8046894e geo-rep: Fix symlink rename syncing issue
Problem:
   Geo-rep sometimes fails to sync the rename of symlink
if the I/O is as follows

  1. touch file1
  2. ln -s "./file1" sym_400
  3. mv sym_400 renamed_sym_400
  4. mkdir sym_400

 The file 'renamed_sym_400' failed to sync to slave

Cause:
  Assume there are three distribute subvolume (brick1, brick2, brick3).
  The changelogs are recorded as follows for above I/O pattern.
  Note that the MKDIR is recorded on all bricks.

  1. brick1:
     -------

     CREATE file1
     SYMLINK sym_400
     RENAME sym_400 renamed_sym_400
     MKDIR sym_400

  2. brick2:
     -------

     MKDIR sym_400

  3. brick3:
     -------

     MKDIR sym_400

  The operations on 'brick1' should be processed sequentially. But
  since MKDIR is recorded on all the bricks, The brick 'brick2/brick3'
  processed MKDIR first before 'brick1' causing out of order syncing
  and created directory sym_400 first.

  Now 'brick1' processed it's changelog.

     CREATE file1 -> succeeds
     SYMLINK sym_400 -> No longer present in master. Ignored
     RENAME sym_400 renamed_sym_400
            While processing RENAME, if source('sym_400') doesn't
            present, destination('renamed_sym_400') is created. But
            geo-rep stats the name 'sym_400' to confirm source file's
            presence. In this race, since source name 'sym_400' is
            present as directory, it doesn't create destination.
            Hence RENAME is ignored.

Fix:
  The fix is not rely only on stat of source name during RENAME.
  It should stat the name and if the name is present, gfid should
  be same. Only then it can conclude the presence of source.

fixes: bz#1600405
Change-Id: I9fbec4f13ca6a182798a7f81b356fe2003aff969
Signed-off-by: Kotresh HR <khiremat@redhat.com>
2018-07-12 04:33:08 -04:00
970ea7a919 core/various: python3 compat, prepare for python2 -> python3
see https://review.gluster.org/#/c/19788/,
    https://review.gluster.org/#/c/19871/,
    https://review.gluster.org/#/c/19952/,
    https://review.gluster.org/#/c/20104/,
    https://review.gluster.org/#/c/20162/,
    https://review.gluster.org/#/c/20185/,
    https://review.gluster.org/#/c/20207/,
    https://review.gluster.org/#/c/20227/,
    https://review.gluster.org/#/c/20307/,
    https://review.gluster.org/#/c/20320/,
    https://review.gluster.org/#/c/20332/,
    https://review.gluster.org/#/c/20364/, and
    https://review.gluster.org/#/c/20441/

Fixes some overlooked string.join()s:
+ AFAICT extras/profiler/glusterfs-profiler, extras/prot_filter.py,
extras/rebalance.py, and extras/volfilter.py would only manifest at
runtime.
+ xlators/experimental/fdl/src/gen_recon.py is a build-time error when
using python3 during the build, thus was not noticed previously when
building with python2.
+ extras/create_new_xlator/generate_xlator.py seems to be example code
and does not affect the build or runtime AFAICT

Note: Fedora packaging guidelines and SUSE rpmlint require explicit
shebangs; popular practices like #!/usr/bin/env python and #!/usr/bin/python
are not allowed; they must be #!/usr/bin/python2 or #!/usr/bin/python3

Note: Selected small fixes from 2to3 utility. Specifically apply,
basestring, funcattrs, has_key, idioms, map, numliterals, raise,
set_literal, types, urllib, and zip have already been applied. Also
version agnostic imports for urllib, cpickle, socketserver, _thread,
queue, etc., suggested by Aravinda in https://review.gluster.org/#/c/19767/1

Note: these 2to3 fixes report no changes are necessary: asserts, buffer,
exec, execfile, exitfunc, filter, getcwdu, imports2, input, intern,
itertools, metaclass, methodattrs, ne, next, nonzero, operator, paren,
raw_input, reduce, reload, renames, repr, standarderror, sys_exc, throw,
tuple_params, xreadlines.

Change-Id: Ia1fe2958d136f4303e30f7e7e86b6fe7d7b52c81
updates: #411
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
2018-07-12 04:38:57 +00:00
b32ad78516 snapshot : remove stale entry
During snap delete after removing brick-path we should remove
        snap-path too i.e. /var/run/gluster/snaps/<snap-name>.

        During snap deactivate also we should remove snap-path.

Change-Id: Ib80b5d8844d6479d31beafa732e5671b0322248b
fixes: bz#1597662
Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
2018-07-12 04:35:58 +00:00
e893eb1b23 glusterd: _is_prefix should handle 0-length paths
If one of the paths given to _is_prefix is 0-length, then it is not a
prefix of the other. Hence, _is_prefix should return false.

Change-Id: I54aa577a64a58940ec91872d0d74dc19cff9106d
fixes: bz#1599783
Signed-off-by: Kaushal M <kaushal@redhat.com>
2018-07-11 10:48:46 +05:30
2e18269a80 glusterd: log improvements on brick creation validation
Added few log entries in glusterd_is_brickpath_available ().

Change-Id: I8b758578f9db90d2974f7c79126c50ad3a001d71
Updates: bz#1193929
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
2018-07-11 04:14:07 +00:00
69f77d28c3 md-cache: Do not invalidate cache post set/remove xattr
Since setxattr and removexattr fops cbk do not carry poststat,
the stat cache was being invalidated in setxatr/remoxattr cbk.
Hence the further lookup wouldn't be served from cache.
To prevent this invalidation, md-cache is modified to get
the poststat in set/removexattr_cbk in dict.

Co-authored with Xavi Hernandez.

Change-Id: I6b946be2d20b807e2578825743c25ba5927a60b4
fixes: bz#1586018
Signed-off-by: Xavi Hernandez <xhernandez@redhat.com>
Signed-off-by: Poornima G <pgurusid@redhat.com>
2018-07-11 04:11:59 +00:00
af6c6429f9 server: Set ssl-allow option in options table and rename ID
This change explicitly adds 'ssl-allow' options to the server xlator's
options table so that glusterd2 can see it as a settable option. This
change also marks 'auth.allow' and 'auth.reject' options as a settable.

Glusterd2 doesn't maintain a separate volume options table. Glusterd2
dynamically loads shared objects of xlators to read their option table
and other information. Glusterd2 reads 'xlator_api_t' if available. If
that's not available, it falls back to reading just the options table
directly.

In glusterd2, volume set operations are performed by users on keys of
the format <xlator>.<option-name>. Glusterd2 uses xlator name set in
'xlator_api_t.identifier'. If that's not present it will use the shared
object's file name as xlator name. Hence, it is important for
'xlator_api_t.identifier' to be set properly, and in this case, the
proper value is "server". This name shall be used by users as prefix
while setting volume options implemented in server xlator. The name will
also be used in volfile.

A user in glusterd2 can authorize a client over TLS as follows:

$ glustercli volume set <volname> server.ssl-allow <client1-CN>[,<clientN-CN>]

gd2 References:
https://github.com/gluster/glusterd2/issues/971
https://github.com/gluster/glusterd2/issues/214
https://github.com/gluster/glusterd2/pull/967

Updates: bz#1193929
Change-Id: I59ef58acb8d51917e6365a83be03e79ae7c5ad17
Signed-off-by: Prashanth Pai <ppai@redhat.com>
2018-07-11 04:08:29 +00:00
e57cbae0bc dht: Inconsistent permission for directories after brick stop/start
Problem: Inconsistent access permissions on directories after
         bringing back the down sub-volumes, in case of directories dht_setattr
         first wind a call on MDS once call is finished on MDS then wind a call
         on NON-MDS.At the time of revalidating dht just compare the uid/gid with
         stbuf uid/gid and if anyone differs set a flag to heal the same.

Solution: Add a condition to compare permission also in dht_revalidate_cbk
          to set a flag to call dht_dir_attr_heal.

BUG: 1584517
Change-Id: I3e039607148005015b5d93364536158380d4c5aa
fixes: bz#1584517
Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
2018-07-11 03:13:24 +00:00
e31c7a7c0c changelog: fix br-state-check.t crash for brick_mux
Problem: br-state-check.t is getting crash

Solution: Check condition in rpcsvc_request_create
          before allocate memory from rxpool

BUG: 1597776
Change-Id: I4fde1ade6073f603c32453f1840395db9a9155b7
fixes: bz#1597776
Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
2018-07-11 03:11:45 +00:00
f4497ee445 Update mount-shared-storage.sh to automatically include all enabled glusterfs mounts in fstab
Currently the mount-shared-storage.sh script requires manual entry of each volume and mount point. There is a TODO item from Bug 1452527 to automatically pull the list of glusterfs mounts from the /etc/fstab file, validate that they are mounted, or attempt to mount them. This is to complete that TODO item.

The extras/mount-shared-storage.sh file has been updated to read only active glusterfs mounts from the /etc/fstab file, verify if they are mounted, and attemt to mount them if they are not. It will exit with a status 0 if successfully mounted or status 1 if any of the mounts fail.

This method will allow the standard method of mounts in /etc/fstab to be utilized and will ensure they are monted following system reboots.

This can be tested by creating a volume, mounting it using the /etc/fstab method, and rebooting the server. Output will be similar to this:
Jun 29 19:09:38 localhost systemd[1]: Starting Mount glusterfs sharedstorage...
Jun 29 19:09:43 localhost mount-shared-storage.sh[4096]: /mnt/mount1 has been mounted
Jun 29 19:09:48 localhost mount-shared-storage.sh[4096]: /mnt/mount2 has been mounted
Jun 29 19:09:48 localhost systemd[1]: Started Mount glusterfs sharedstorage.

Multiple fixes based on code review suggestions and spellcheck

Removed spaces in grep for glusterfs as tabs are valid as well

Added tab as an IFS field separator for the lines read from /etc/fstab

Increased sleep time to 10 seconds before mount validation

Changed mount check to use “mountpoint -q”

Change-Id: Ib90c99ced8f7aefc8dbe87340afc73a28f6195e7
fixes: bz#1596789
Signed-off-by: Josiah <josiahp@gmail.com>
2018-07-10 19:38:48 +00:00
6dc5dfef81 Fix compile warnings
This patch fixes compile warnings that appear with newer compilers. The
solution applied is only to remove the warnings, but it doesn't always
solve the problem in the best way. It assumes that the problem will never
happen, as the previous code assumed.

Change-Id: I6e8470d6c2e2dbd3bd7d324b5fd2f92ffdc3d6ec
updates: bz#1193929
Signed-off-by: Xavi Hernandez <xhernandez@redhat.com>
2018-07-10 16:28:24 +02:00
03f1f5bdc4 cluster/afr: Prevent execution of code after call_count decrementing
Problem:
When call_count is decremented by one thread, another thread can
go ahead with the operation leading to undefined behavior for the
thread executing statements after decrementing call count.

Fix:
Do the operations necessary before decrementing call count.

fixes bz#1598663
Change-Id: Icc90cd92ac16e5fbdfe534d9f0a61312943393fe
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
2018-07-10 04:13:01 +00:00
886ee4dfac posix: Do not log ENXIO errors for seek fop
When lseek is used with SEEK_DATA and SEEK_HOLE, it's expected that the
last operation fails with ENXIO when offset is beyond the end of file.
In this case it doesn't make sense to report this as an error log message.

This patch reports ENXIO failure messages for seek fops in debug level
instead of error level.

Change-Id: I62a4f61f99b0e4d7ea6a2cdcd40afe15072794ac
fixes: bz#1598926
Signed-off-by: Xavi Hernandez <xhernandez@redhat.com>
2018-07-10 04:09:37 +00:00
c30283fd27 io-stats: Terminate dump thread when dump interval is set to 0
_ios_dump_thread is not terminated by the function
_ios_destroy_dump_thread when the diagnostic interval is set
to 0 (which means disable auto dumping).

During reconfigure, if the value changes from 0 to another
then the thread is started, but on reconfiguring this to 0
the thread is not being terminated.

Further, if the value is changed from 0 to X to 0 to Y, where
X and Y are 2 arbitrary duration numbers, the reconfigure
code ends up starting one more thread (for each change from
0 to a valid interval).

This patch fixes the same by terminating the thread when the
value changes from non-zero to 0.

NOTE: It would seem nicer to use conf->dump_thread and check
its value for thread presence etc. but there is no documented
invalid value for the same, and hence an invalid check is not
feasible, thus introducing a new running bool to determine the
same.

Fixes: bz#1598548
Change-Id: I3e7d2ce8f033879542932ac730d57bfcaf14af73
Signed-off-by: ShyamsundarR <srangana@redhat.com>
2018-07-09 15:07:56 +00:00
16f02433df core: Increase SCRIPT_TIMEOUT for bug-1432542-mpx-restart-crash.t
BUG: 1599250
Change-Id: I27bda2a0764580289e7154766e13a0c358cba3a8
fixes: bz#1599250
Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
2018-07-09 16:45:33 +05:30
fc06ba7d35 contrib: Remove contrib/ipaddr-py entirely.
This module is no longer being used.
Fixes: bz#1597512

Change-Id: Ie5faf55c5961d9d7b5082c9c257351af712c41d7
Signed-off-by: Nigel Babu <nigelb@redhat.com>
2018-07-09 03:39:04 +00:00
55d1b0531a core/various: python3 compat, prepare for python2 -> python3
see https://review.gluster.org/#/c/19788/,
    https://review.gluster.org/#/c/19871/,
    https://review.gluster.org/#/c/19952/,
    https://review.gluster.org/#/c/20104/,
    https://review.gluster.org/#/c/20162/,
    https://review.gluster.org/#/c/20185/,
    https://review.gluster.org/#/c/20207/,
    https://review.gluster.org/#/c/20227/,
    https://review.gluster.org/#/c/20307/,
    https://review.gluster.org/#/c/20320/,
    https://review.gluster.org/#/c/20332/, and
    https://review.gluster.org/#/c/20364/

Fixes glupy.py python2isms, iteritems -> items, and some overlooked 
print() in georep/peer_mountbroker.in

Note: Fedora packaging guidelines and SUSE rpmlint require explicit
shebangs; popular practices like #!/usr/bin/env python and #!/usr/bin/python
are not allowed; they must be #!/usr/bin/python2 or #!/usr/bin/python3

Note: Selected small fixes from 2to3 utility. Specifically apply,
basestring, funcattrs, has_key, idioms, map, numliterals, raise,
set_literal, types, urllib, and zip have already been applied. Also
version agnostic imports for urllib, cpickle, socketserver, _thread,
queue, etc., suggested by Aravinda in https://review.gluster.org/#/c/19767/1

Note: these 2to3 fixes report no changes are necessary: asserts, buffer,
exec, execfile, exitfunc, filter, getcwdu, imports2, input, intern,
itertools, metaclass, methodattrs, ne, next, nonzero, operator, paren,
raw_input, reduce, reload, renames, repr, standarderror, sys_exc, throw,
tuple_params, xreadlines.

Change-Id: Idda031c1ec975417c79323aea33e7b694e752b2a
updates: #411
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
2018-07-09 03:38:36 +00:00
dab12ce093 glusterfs: Brick process is crash at the time of call server_first_lookup
Problem: Brick process is getting crash while executing test case
         tests/bugs/core/bug-1432542-mpx-restart-crash.t

Solution: At the time of initiating connection with brick process by
          client brick process call server_setvolume.If cleanup thread
          has set cleanup_starting flag after check flag by server_setvolume
          then a brick process can crash at the time of calling lookup
          on brick root.To avoid crash check cleanup_starting
          flag before just call server_first_lookup

BUG: 1597627
Change-Id: I12542c124c76429184df34a04c1eae1a30052ca7
fixes: bz#1597627
Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
Note: To test the patch executing test case
      tests/bugs/core/bug-1432542-mpx-restart-crash.t in a loop
      around 100 times
2018-07-09 03:22:49 +00:00
10b0d73003 Replace the BROKEN_TESTS environment variable value
In distributed-testing framework for regression, the value
of BROKEN_TESTS environment variable needs to be replaced.
This list of broken tests is different from what we have
marked as a bad test in our test suites.

Fixes: bz#1598325
Change-Id: I6a3ca5d9500170201ecaafcd5a96d9df3e46a851
Signed-off-by: Deepshikha Khandelwal <dkhandel@redhat.com>
2018-07-06 10:42:52 +00:00