1
0
mirror of https://github.com/gluster/glusterfs.git synced 2026-02-05 06:47:35 +01:00

13708 Commits

Author SHA1 Message Date
Amar Tumballi
d1d7a6f35c Contributing: update about who can trigger the build
Currently only maintainers listed in github group can trigger the
regression runs, it may change in future!

Updates: #1000
Change-Id: I3b5f1cace8a433886d725539198998875dcdce36
Signed-off-by: Amar Tumballi <amar@kadalu.io>
2020-10-07 13:01:21 +05:30
Amar Tumballi
085910d3b9 Migration: update the docs
* Make CONTRIBUTING.md have complete workflow documented.
* Change './rfc.sh' to reflect the new workflow

Updates: #1000
Also Updates: gluster/project-infrastructure#62

Change-Id: I31becd7cdb35cb68048b662786c31694791d50fe
Signed-off-by: Amar Tumballi <amar@kadalu.io>
2020-10-07 07:14:21 +00:00
Barak Sason Rofman
c271c36ac9 DHT - Removing commit hash and 'magical' return value from rebalance
The order of operation in rebalance is as follows:
gf_defrag_fix_layout - > gf_defrag_process_dir - > gf_defrag_get_entry

gf_defrag_process_dir is passing to gf_defrag_get_entry a pointer to a
variable 'gf_defrag_get_entry', however this value is ignored (remains
unchanged in the method).
Based on the return value from gf_defrag_get_entry,
gf_defrag_process_dir may change it's return value to the 'magical'
number 2, however since the value of 'should_commit_hash' never changes,
this never happnes.
All of this is propagated back to gf_defrag_fix_layout and is now
removed from there as well.

Change-Id: Ibff297650cf84139bd26c830bfa44f81119b60d4
updates: #1002
Signed-off-by: Barak Sason Rofman <bsasonro@redhat.com>
2020-10-07 04:38:50 +00:00
Pranith Kumar K
48a2396549 mount/fuse: Fix graph-switch when reader-thread-count is set
Problem:
The current graph-switch code sets priv->handle_graph_switch to false even
when graph-switch is in progress which leads to crashes in some cases

Fix:
priv->handle_graph_switch should be set to false only when graph-switch
completes.

fixes: #1539
Change-Id: I5b04f7220a0a6e65c5f5afa3e28d1afe9efcdc31
Signed-off-by: Pranith Kumar K <pranith.karampuri@phonepe.com>
2020-10-05 16:57:28 +05:30
Barak Sason Rofman
d63b97c93a dht - Remove "tier" code (part 2)
Part 1 of this patch https://review.gluster.org/#/c/glusterfs/+/24328/

Following part 1, this patch complety removes all traces of
"tier" feature in dht.

This is based in the work done in
https://review.gluster.org/#/c/glusterfs/+/23935/

Change-Id: I7fba1ab7249719301ca578b4a6f4acac748da145
updates: #1097
Signed-off-by: Barak Sason Rofman <bsasonro@redhat.com>
2020-10-01 17:50:15 +03:00
perrynzhou
268faabed0 fixed AFR_READ_POLICY_GFID_PID_HASH policy bug
Change-Id: Ib927a770a486c95e4b157e76ba96e9904d1a9716
Fixes: #1499
Signed-off-by: perrynzhou <perrynzhou@gmail.com>
2020-10-01 13:52:12 +00:00
Pranith Kumar K
9ecbd69127 cluster/afr: Heal directory rename without rmdir/mkdir
Problem1:
When a directory is renamed while a brick
is down entry-heal always did an rm -rf on that directory on
the sink on old location and did mkdir and created the directory
hierarchy again in the new location. This is inefficient.

Problem2:
Renamedir heal order may lead to a scenario where directory in
the new location could be created before deleting it from old
location leading to 2 directories with same gfid in posix.

Fix:
As part of heal, if oldlocation is healed first and is not present in
source-brick always rename it into a hidden directory inside the
sink-brick so that when heal is triggered in new-location shd can
rename it from this hidden directory to the new-location.

If new-location heal is triggered first and it detects that the
directory already exists in the brick, then it should skip healing the
directory until it appears in the hidden directory.

Credits: Ravi for rename-data-loss.t script

Fixes: #1211
Change-Id: I0cba2006f35cd03d314d18211ce0bd530e254843
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
2020-10-01 12:03:25 +00:00
Dmitry Antipov
4ec05d087e build: drop -rdynamic from compiler flags
Since -rdynamic is meaningless during compilation, drop it from
GF_CFLAGS. Note GF_LDFLAGS unconditionally use -rdynamic anyway.

Change-Id: I07c7086a8a6adad8358b88999d98828c1cbfb464
Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Updates: #1002
2020-10-01 07:59:36 +00:00
Barak Sason Rofman
66deb99e74 DHT - Fixing memory allocation crash
The allocation
dir_dfmeta = GF_CALLOC(1, sizeof(*dir_dfmeta), gf_common_mt_pointer);
seems to cause a crash.
From the logs:
[2020-09-24 13:10:13.225935 +0000] I [dht-rebalance.c:3273:gf_defrag_process_dir]
 0-dist-dht: migrate data called on /dir1
[2020-09-24 13:10:13.226587 +0000] E [mem-pool.c:61:gf_mem_set_acct_info]
(-->/usr/local/lib/glusterfs/9dev/xlator/cluster/distribute.so(+0x18e60)
[0x7f4b1f71ee60] -->/usr/local/lib/glusterfs/9dev/xlator/cluster/distribute.so(+0x173ab)
[0x7f4b1f71d3ab] -->/usr/local/lib/libglusterfs.so.0(+0x4d8e5) [0x7f4b357668e5] )
0-: Assertion failed: type <= mem_acct->num_types
[2020-09-24 13:10:13.226623 +0000] E [mem-pool.c:61:gf_mem_set_acct_info]
(-->/usr/local/lib/glusterfs/9dev/xlator/cluster/distribute.so(+0x18e60)
[0x7f4b1f71ee60] -->/usr/local/lib/glusterfs/9dev/xlator/cluster/distribute.so(+0x173d3)
[0x7f4b1f71d3d3] -->/usr/local/lib/libglusterfs.so.0(+0x4d8e5) [0x7f4b357668e5] )
0-: Assertion failed: type <= mem_acct->num_types

The following change fixes that crash.

fixes: #1511
Change-Id: Ibf605648981f7108e863c91a80370cf077ad7c4a
Signed-off-by: Barak Sason Rofman <bsasonro@redhat.com>
2020-10-01 04:01:35 +00:00
Mohammed Rafi KC
8489d42bde bitrot/stub: Fix memory leak gf_br_stub_mt_version_t
The data type gf_br_stub_mt_version_t is leaking because the
data type has been added to the dict as static type and the memory
is not free'd from anywhere else

Change-Id: Ib10134f41f45a39be849af1708b1960c77fb62fd
Fixes: #1427
Signed-off-by: Mohammed Rafi KC <rafi.kavungal@iternity.com>
2020-09-30 17:04:03 +00:00
Mohammed Rafi KC
600d56f893 MAINTAINERS: Changing communication email
Change-Id: I5ae3161d0357ddd62fb6409933837ffd94610d83
Updates: #1002
Signed-off-by: Mohammed Rafi KC <rafi.kavungal@iternity.com>
2020-09-30 16:32:26 +05:30
Môshe van der Sterre
eb4b2cb003 gfapi: Move the SECURE_ACCESS_FILE check out of glfs_mgmt_init
glfs_mgmt_init is only called for glfs_set_volfile_server, but
secure_mgmt is also required to use glfs_set_volfile with SSL.

fixes: #829
Change-Id: Ibc769fe634d805e085232f85ce6e1c48bf4acc66
2020-09-29 14:32:59 +00:00
nik-redhat
773aaddc65 dht: explicit null dereference
Added a null check for uuid_list_copy, to avoid
null dereference in strtok_r() in case of strdup()
failure.

CID: 1325612
CID: 1274223

Updates: #1060

Change-Id: I641a5068cd76d7b2ed92eccf39e7f97d6f7b2480
Signed-off-by: nik-redhat <nladha@redhat.com>
2020-09-29 14:32:09 +00:00
nik-redhat
748d7fe9cb locks: null dereference
Added a null check before executing the strtok_r()
to avoid null dereference in case of strdup() failure.

CID: 1407938
Updates: #1060

Change-Id: Iec6e72ae8cb54f6d0a287615c43756325b2026ec
Signed-off-by: nik-redhat <nladha@redhat.com>
2020-09-29 14:04:11 +00:00
Sanju Rakonde
a0effc34af glusterd: start the brick on a different port
Problem: brick fails to start when the port provided by
glusterd is in use by any other process

Solution: glusterd should check errno set by runner_run()
and if it is set to EADDRINUSE, it should allocate a new
port to the brick and try to start it again.

Previously ret value is checked instead of errno, so the
retry part never executed. Now, we initialize errno to 0
before calling runner framework. and afterwards store the
errno into ret to avoid modification of errno in subsequent
function calls.

fixes: #1101

Change-Id: I1aa048a77c5f8b035dece36976d60602d9753b1a
Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
Signed-off-by: nik-redhat <nladha@redhat.com>
2020-09-29 13:15:21 +00:00
pranith.karampuri
14a1e346c0 MAINTAINERS: Changing communication email
Updates: #1002
Change-Id: I1b8fb6430a6a64fc813bdd111a31b3574ffc06a1
Signed-off-by: Pranith Kumar K <pranith.karampuri@phonepe.com>
2020-09-29 12:07:13 +00:00
srijan-sivakumar
2d2ea54a2c glusterd: Replacing str with ptr in strchr to reduce comparison
Issue: On seeing the function glusterd_replace_slash_with_hyphen
we see that the strchr inside the while loop takes str as a
parameter, that'd mean repeated comparison from index 0 of str
even though the characters have already been compared. Why not
use ptr instead which points to the latest replacement in the
string.

Code change: replacing str with ptr inside the strchr function.

Fixes: #1516
Change-Id: Id049ec2ad9800a01730f2a0263d9e0528557ae81
Signed-off-by: srijan-sivakumar <ssivakum@redhat.com>
2020-09-28 06:09:36 +00:00
Mohit Agrawal
d34daa73fe dht: Ongoing IO is failing on non-distribute volumes after just add-brick
Problem: On a non-distributed volumes linux kernel untar is failed
         after running add-brick operation

Solution:
1) Save hashed subvol as a MDS in case while MDS has not been
   populated

Fixes: #1328
Change-Id: I9967e136da008c6367973a7346637617dfa8f934
Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
2020-09-28 03:55:41 +00:00
nik-redhat
99df784c1c glusterd: resource leaks
Issue:
iobref was not freed before exiting the function.

Fix:
Modified the code to free iobref before exiting.

CID: 1430107
Updates: #1060

Change-Id: I89351b3aa645792eb8dda6292d1e559057b02d8b
Signed-off-by: nik-redhat <nladha@redhat.com>
2020-09-25 17:59:22 +05:30
Xavi Hernandez
9310e319da gfapi: Check the fd argument before accessing it
Some public GFAPI functions did access the fd object without verifying
that it wasn't NULL, causing crashes in some cases.

This patch returns an error code in case it's NULL.

Updates: #1009
Change-Id: I8cadde87ae8d542e0af9b55aa866fe763f97d4fb
Signed-off-by: Xavi Hernandez <xhernandez@redhat.com>
2020-09-25 04:00:15 +00:00
Barak Sason Rofman
d7ce8331a1 DHT - fixing a bug in thread creation
The 3rd argument of gf_thread_create is a pointer to a method, however
in this case, a pointer to a pointer to a method is passed (2 levels of
indirection instead of 1).

Change-Id: Ic2d4ea75aa54c6bc85a80bd0277a0efa5e5814ad
updates: #1002
Signed-off-by: Barak Sason Rofman <bsasonro@redhat.com>
2020-09-24 16:29:56 +03:00
Sheetal Pamecha
3b8ee834a3 glusterd: Fix Add-brick with increasing replica count failure
Problem: add-brick operation fails with multiple bricks on same
server error when replica count is increased.

This was happening because of extra runs in a loop to compare
hostnames and if bricks supplied were less than "replica" count,
the bricks will get compared to itself resulting in above error.

Fixes: #1508
Change-Id: I8668e964340b7bf59728bb838525d2db062197ed
Signed-off-by: Sheetal Pamecha <spamecha@redhat.com>
2020-09-24 12:49:15 +00:00
Kaleb S. KEITHLEY
a65c3f7073 build: when building with tirpc, link with libtirpc
uncovered on Ubuntu Groovy (20.10, ubuntu's bleeding edge devel dist),
seems to now have stricter link semantics than it did when we last
built 8.1 and 7.5.

Many xlators actually do have direct calls to xdr_sizeof(), so strictly
speaking they should be linked with libtirpc.

Change-Id: Iee1fd3528fde19db397c4eae6978d9b9a2c3e17f
Updates: #1002
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
2020-09-24 11:46:46 +00:00
srijan-sivakumar
ecb8d66675 glusterd: Removing strlen and using existing len field of data_t
Issue: The strlen being used to find the length of the dictionary is
an extra step as there already exists len field in data_t which contains
the same value.

Code Change :
1. Replacing the strlen with len.
2. Removing a typecast which wasn't required.

Fixes: #1497
Change-Id: I2780c3876b17b8825038d222fb489a87e090411f
Signed-off-by: srijan-sivakumar <ssivakum@redhat.com>
2020-09-24 03:32:54 +00:00
srijan-sivakumar
5a1644c892 glusterd: Fixing coverity issues.
Fixing Incorrect expression (IDENTICAL_BRANCHES) reported by
the coverity scan.

CID: 1432721

Change-Id: If6ab3a129dffb6c5fcc618e775f99bc1125003ab
Updates: #1060
Signed-off-by: srijan-sivakumar <ssivakum@redhat.com>
2020-09-24 03:31:03 +00:00
Mohit Agrawal
168142748d nfs: test case bugs_nfs_bug-1116503.t is crashed
test case is crashed because GF_ASSERT is failing
in gf_mem_set_acct_info function due to access global
xlator instead of accessing nfs xlator.To avoid the
crash pass nfsx at the time of calling nsm_thread
to set the THIS.

Fixes: #1506
Change-Id: Ifd8afcdf39578aa44332d1b79744a4e9910fe7c6
Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
2020-09-23 13:40:51 +05:30
Pranith Kumar K
eedddaa7ec cluster/ec: Track heal statistics in shd
With this change we should be able to inspect number of heals
attempted and completed by each shd.

fixes: #1453
Change-Id: I10f5d86efcc0a8e4d648da808751d37725682c39
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
2020-09-22 06:21:01 +00:00
Sanju Rakonde
f86b1d4459 glusterd: add post-commit phase to the transaction
This is part 2 of the fix. part 1 is at
https://review.gluster.org/#/c/glusterfs/+/24325/

This patch adds post commit phase to the mgmt v3 transaction
framework.

In post commit phase we replace the old auth.allow list
in case of add-brick and replace-brick.

fixes: #1391

Change-Id: I41c871d59e6252d27163b042ad710e929d7d0399
Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
2020-09-21 03:58:30 +00:00
nik-redhat
0ec6d61567 glusterd: mount directory getting truncated on mounting shared_storage
Issue:
In case of a user created volume the mount point
is the brick path 'ex: /data/brick' but in case of
shared_storage the mount point is '/'.So, here
we increment the array by one so as to get the exact
path of brick without '/', which works fine for other
volumes as the pointer of the brick_dir variable is
at '/', but for shared_storage it is at 'v'(where v is
starting letter of 'var' directory). So, on incrementing
the path we get in case of shared_storage starts from
'ar/lib/glusterd/...'

Fix:
Only, increment the pointer if the current position is '/',
else the path will be wrong.

Fixes: #1480

Change-Id: Id31bb13f58134ae2099884fbc5984c4e055fb357
Signed-off-by: nik-redhat <nladha@redhat.com>
2020-09-20 14:06:23 +00:00
Srijan Sivakumar
558fe62a28 glusterd:Reducing file operations when writing options into volfile.
Issue: The options to be written into the volfile are in form of
key-value pairs and the current approach taken to write them into
a file is to invoke the write syscall for each key-value pair.
This implies an increased number of system calls.

Code Changes:
1. Addition of a structure, glusterd_volinfo_data_store_t in
glusterd-store.h, containing a character buffer, a pointer to
gf_store_handle_t, the current length of data in the buffer as
well as a flag for checking key while storing in the buffer.
This is used for passing the required file descriptor as well
having a character buffer for storing multiple options before
being written into a file.

2. Modification of function, _storeopts in glusterd-store.c, which
now invokes the gf_store_save_items when buffer is to be emptied
into the volfile before further write into it. Also, it has
replaced the function _storeslaves, _gd_store_rebalance_dict
and _store_global_opts.

3. Modification of function, glusterd_store_volinfo_write in
glusterd-store.c, wherein a pointer of type
glusterd_volinfo_data_store_t is initialized for further
operation. Also, the buffer is emptied into the volfile before
it is freed.

4. Modification of function, glusterd_store_node_state_write in
glusterd-store.c, wherein the a pointer of type
glusterd_volinfo_data_store_t is initialized for further operations.
Also, the buffer is emptied into the volfile before it is freed.

5. Addition of enum into glusterd-mem-types.h

6. Modification of function, glusterd_store_options in
glusterd-store.c, wherein a pointer of type
glusterd_volinfo_data_store_t is initialized for further opertaions.
Also, the buffer is emptied into the volfile before it is freed.

Reasoning behind the approach:
1.Instead of a dynamic allocation of buffer or increasing the buffer
size with increased number of options, it, the current approach takes
a buffer of fixed size (VOLINFO_BUFFER_SIZE). Before any write into
the buffer, the size is checked and if it exceeds the available space,
the contents of the buffer are written to the file before copying new
contents. Dynamic allocation can lead to increased memory usage as one
doesn't know the number of options that could be added in time and may
go on to occupy more space than mandated.

2.The function dict_foreach is a generic function used across different
modules. It made sense not to change its implementation as it might
affect other Functionalities. Hence a structure was added which could
just be passed as one of the parameter to this function (as it takes
a void*).

3. Reduced number of system calls implies an increase in execution speed.
Also, these modified functions come into play whenever the volume is
started or modified.

4. The functions _storeslaves, _gd_store_rebalace_dict and
_store_global_opts were doing the same set of operations as that of
_storeopts except the checking for the key. This has been handled
with the help of a flag in the glusterd_volinfo_data_store_t structure.
This reduces the duplicate code present.

Signed-off-by: Srijan Sivakumar <ssivakum@redhat.com>
Change-Id: I22e6e91c78ed51e3a171482054d77bf793b9ab16
Fixes: #718
2020-09-17 12:10:58 +00:00
srijan-sivakumar
5348292bf0 quota_fsck.py fails with UnicodeDecodeError
Issue: While decoding the byte characters the quota_fsck
script stumbled across a corner case wherein the file names
given by the getfattr dump will cause the decoding to UTF-8
to fail with UnicodeDecodeError.

Code Change:
On looking through the quota_fsck.py script, it seems like
the file path is actually not needed when decoding for the
xattr parsing, hence the code change reflects that. Also,
removed a comparison which previously existed to skip the
file names as that won't be required now.

Fixes: #1487
Change-Id: I8a13ab07be6c9cfafae996f17764fbb4a285bd8c
Signed-off-by: srijan-sivakumar <ssivakum@redhat.com>
2020-09-16 09:01:53 +05:30
Pranith Kumar K
a699974a69 nfs: Use static api to set static data in dict
fixes: #1477
Change-Id: I8b9f76887f4617f82d09291205e28e3fb5ddc8e0
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
2020-09-14 14:22:51 +00:00
nik-redhat
84a4cf7621 glusterd: readdir-ahead off by default
Changing the default value of readdir-ahead to
off, but it can be enabled/disabled later on if with
gluster vol set <volname> performance.readdir-ahead enabel/disable
command.

Fixes: #1472

Change-Id: Idb3e16e8be98d7a811fc8e5d09906919ef50fbab
Signed-off-by: nik-redhat <nladha@redhat.com>
2020-09-14 08:35:36 +00:00
nik-redhat
4bd4d1ce6e glusterd: fixing coverity issues
In the last patch merge for the performance.readdir
-ahead dependencies, there was few issues with return
check and NULL derefencing. So, fixed that as per
the coverity scanner.

CID: 1432493
CID: 1432492

Updates: #1060

Change-Id: I6dee6d35ef41ab8d6322f1b2e3734c4796ee2804
Signed-off-by: nik-redhat <nladha@redhat.com>
2020-09-11 07:52:47 +00:00
Shwetha K Acharya
e96bb6d806 nfs-ganesha: gluster_shared_storage fails to automount on node reboot on rhel 8
The patch https://review.gluster.org/#/c/glusterfs/+/24934/, changes mount point
of gluster_shared_storage from /var/run to /run to address the issue of symlink
at mount path in fstab.
NOTE: mount point /var/run is symlink to /run

The required changes with respect to gluster_shared_storage mount path are
introduced with this patch in nfs-ganesha.

Fixes: #1475
Change-Id: I9c7677a053e1291f71476d47ba6fa2e729f59625
Signed-off-by: Shwetha K Acharya <sacharya@redhat.com>
2020-09-10 12:47:16 +00:00
Shwetha K Acharya
41ee60d275 extras/snap_scheduler: changes in gluster-shared-storage mount path
The patch https://review.gluster.org/#/c/glusterfs/+/24934/, changes mount point
of gluster_shared_storage from /var/run to /run to address the issue of symlink
at mount path in fstab.
NOTE: mount point /var/run is symlink to /run

The required changes with respect to gluster_shared_storage mount path are
introduced with this patch in snap_scheduler.

Fixes: #1476
Change-Id: I9ce88c2f624c6aa5982de04edfee2d0a9f160d62
Signed-off-by: Shwetha K Acharya <sacharya@redhat.com>
2020-09-10 12:42:08 +00:00
Shwetha K Acharya
24c7d694b4 geo-rep: gluster_shared_storage fails to automount on node reboot on rhel 8.
Issue: On reboot, all the mounts get wiped out.
       Only the mounts mentioned in /etc/fstab  automatically gets mounted
       during boot/reboot.

       But /etc/fstab complains on not getting a canonical path
       (it gets path containing a symlink)
       This is because the gluster_shared_storage, is mounted to
       /var/run which is symlink to /run. This is a general practice
       followed by most operating systems.

       [root@ ~]# ls -lsah /var/run
       0 lrwxrwxrwx. 1 root root 6 Jul 22 19:39 /var/run -> ../run

Fix:   Mount gluster_shared_storage on /run.
       (Also It is seen that /var/run is mostly
        used by old or legacy systems, thus it is a good practice to
        update /var/run to /run)

fixes: #1459
Change-Id: I8c16653be8cd746c84f01abf0eea19284fb97c77
Signed-off-by: Shwetha K Acharya <sacharya@redhat.com>
2020-09-10 12:12:15 +00:00
nik-redhat
aec219826e glusterd: automatically turn on dependencies for parallel-readdir
Issue:
On setting the performance.parallel-readdir to "on"
the dependencies of it should automatically be
turned on and readdir-ahead should be the parent
of each dht subvolume.

Fix:
On enabling the parallel-readdir, the dependencies
are turned on by enabling readdir-ahead simultaneously,
and readdir-ahead will be seen as the parent of each
dht subvolume.

Fixes: #1416

Change-Id: Ic83ae470152b88edddc274d5e6c4d74169d23c15
Signed-off-by: nik-redhat <nladha@redhat.com>
2020-09-08 09:54:20 +00:00
Pranith Kumar K
0935afb947 rpcsvc: Add latency tracking for rpc programs
Added latency tracking of rpc-handling code. With this change we
should be able to monitor the amount of time rpc-handling code is
consuming for each of the rpc call.

fixes: #1466
Change-Id: I04fc7f3b12bfa5053c0fc36885f271cb78f581cd
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
2020-09-07 19:15:10 +00:00
Dmitry Antipov
c696144b36 xlators: prefer libglusterfs time API
Prefer timespec_now_realtime() and gf_time() over clock_gettime()
and time(), use gf_tvdiff() and gf_tsdiff() where appropriate,
drop unused time_elapsed() and leftovers in 'struct posix_private'.

Change-Id: Ie1f0229df5b03d0862193ce2b7fb91d27b0981b6
Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Updates: #1002
2020-09-07 12:56:45 +00:00
Xavi Hernandez
a1c89afd79 open-behind: implement create fop
Open behind didn't implement create fop. This caused that files created
were not accounted for the number of open fd's. This could cause future
opens to be delayed when they shouldn't.

This patch implements the create fop. It also fixes a problem when
destroying the stack: when frame->local was not NULL, STACK_DESTROY()
tried to mem_put() it, which is not correct.

Fixes: #1440
Change-Id: Ic982bad07d4af30b915d7eb1fbcef7a847a45869
Signed-off-by: Xavi Hernandez <xhernandez@redhat.com>
2020-09-07 12:56:36 +00:00
Dmitry Antipov
9b553b3ddf glusterfsd, libglusterfs, rpc: prefer libglusterfs time API
Use timespec_now_realtime() rather than clock_gettime().

Change-Id: I8fa00b7c0f7b388305c7d19574be3b409db68558
Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Updates: #1002
2020-09-07 12:56:08 +00:00
Dmitry Antipov
4e81a5e47a build: extend --enable-valgrind to support Memcheck and DRD
Extend '-enable-valgrind' to '--enable=valgrind[=memcheck,drd]'
to enable Memcheck or DRD Valgrind tool, respectively.

Change-Id: I80d13d72ba9756e0cbcdbeb6766b5c98e3e8c002
Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Updates: #1002
2020-09-05 02:14:19 +00:00
Ravishankar N
079f7a7d8a libglusterfs: fix dict leak
Problem:
gf_rev_dns_lookup_cached() allocated struct dnscache->dict if it was null
but the freeing was left to the caller.

Fix:
Moved dict allocation and freeing into corresponding init and fini
routines so that its easier for the caller to avoid such leaks.

Updates: #1000
Change-Id: I90d6a6f85ca2dd4fe0ab461177aaa9ac9c1fbcf9
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
2020-09-04 13:43:30 +00:00
nik-redhat
cede859c73 glusterd: use after free (coverity issue)
Issue:
dict_unref is called on the same dict again,
in the out label of the code, which causes the
use after free issue.

Fix:
Set the dict to NULL after unref, to avoid
use after free issue.

CID: 1430127

Updates: #1060

Change-Id: Ide9a5cbc5f496705c671e72b0260da6d4c06f16d
Signed-off-by: nik-redhat <nladha@redhat.com>
2020-09-04 11:11:44 +00:00
nik-redhat
865cca1190 glusterd: cksum mismatch on upgrading to latest gluster
Issue:
In gluster versions less than 7, the checksums were calculated
whether or not the quota is enabled or not, and that cksum value
was also getting stored in the quota.cksum file. But, from gluster
7 version onwards cksum was calculated only if the quota is enabled.
Due to this, the cksums in quota.cksum files differ after upgrading.

Fix:
Added a check to see if the OP_VERSION is less than 7 then, follow
the previous method otherwise, move as per the latest changes for
cksum calculation.

This changes for the cksum calculation was done in
this commit : https://github.com/gluster/glusterfs/commit/3b5eb592f5

Fixes: #1332

Change-Id: I7a95e5e5f4d4be4983fb7816225bf9187856c003
Signed-off-by: nik-redhat <nladha@redhat.com>
2020-09-04 10:43:01 +00:00
Mohit Agrawal
c7154b8411 core: Avoid dict OR key is NULL message in brick logs
Problem: At the time of mount a volume server_first_lookup
        call's syncop_lookup with a NULL xattr so index_lookup
        is throwing a message at the time of fetching "link-count"
        from a dictionary

Solution: Call dict_get_str_sizen instead of calling dict_get_str
          to avoid a warning message

Fixes: #1464
Change-Id: I2b1ee3123ab817fa09f3abe39998c0d66ac0b824
Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
2020-09-04 07:23:09 +00:00
Pranith Kumar K
5797021ae8 cluster/ec: Don't trigger heal for stale index
Fixes: #1385
Change-Id: I3609dd2e1f63c4bd6a19d528b935bf5b05443824
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
2020-09-04 05:12:33 +00:00
Rinku Kothiya
b8417a4b4a build: Added dependency for glusterfs-selinux
Fixes: #1442

Change-Id: I7d79bceff329db4d525bc8a77ba7ffe41bf53c97
Signed-off-by: Rinku Kothiya <rkothiya@redhat.com>
2020-09-03 11:30:42 +00:00
Srijan Sivakumar
ebc0253269 Events: Fixing coverity issues.
Fixing resource leak reported by coverity scan.

CID: 1431237

Change-Id: I2bed106b3dc4296c50d80542ee678d32c6928c25
Updates: #1060
Signed-off-by: Srijan Sivakumar <ssivakum@redhat.com>
2020-09-03 02:54:47 +00:00