Compare commits
No commits in common. "4eac2268822f44a17e3dcf142c01328211bd5c31" and "2e3883d94d2635c81297af88001490b9645124e7" have entirely different histories.
4eac226882
...
2e3883d94d
34
0001-SC2081-can-t-match-globs-Use-or-grep.patch
Normal file
34
0001-SC2081-can-t-match-globs-Use-or-grep.patch
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
From 396f52a60bbe5eba0075b1658d84e46cbf7461ab Mon Sep 17 00:00:00 2001
|
||||||
|
From: zhanchengbin <zhanchengbin1@huawei.com>
|
||||||
|
Date: Thu, 13 Oct 2022 10:34:52 +0800
|
||||||
|
Subject: [PATCH] SC2081: [ .. ] can't match globs. Use [[ .. ]] or grep.
|
||||||
|
|
||||||
|
Shellcheck check out a problem.
|
||||||
|
|
||||||
|
Signed-off-by: zhanchengbin <zhanchengbin1@huawei.com>
|
||||||
|
---
|
||||||
|
.../add-brick/post/disabled-quota-root-xattr-heal.sh | 4 ++--
|
||||||
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/extras/hook-scripts/add-brick/post/disabled-quota-root-xattr-heal.sh b/extras/hook-scripts/add-brick/post/disabled-quota-root-xattr-heal.sh
|
||||||
|
index ca17a90..969d6fc 100755
|
||||||
|
--- a/extras/hook-scripts/add-brick/post/disabled-quota-root-xattr-heal.sh
|
||||||
|
+++ b/extras/hook-scripts/add-brick/post/disabled-quota-root-xattr-heal.sh
|
||||||
|
@@ -1,4 +1,4 @@
|
||||||
|
-#!/bin/sh
|
||||||
|
+#!/bin/bash
|
||||||
|
|
||||||
|
##---------------------------------------------------------------------------
|
||||||
|
## This script updates the 'limit-set' xattr on the newly added node. Please
|
||||||
|
@@ -106,7 +106,7 @@ ENABLED_STATE_1="${GLUSTERD_WORKDIR}/hooks/${VERSION}/${VOLUME_OP}/"
|
||||||
|
ENABLED_STATE_2="post/${ENABLED_NAME_PREFIX}${VOL_NAME}-${ENABLED_NAME}"
|
||||||
|
ENABLED_STATE="${ENABLED_STATE_1}${ENABLED_STATE_2}"
|
||||||
|
|
||||||
|
-if [ "${THIS_SCRIPT}" != *"${VOL_NAME}"* ]; then
|
||||||
|
+if [[ "${THIS_SCRIPT}" != *"${VOL_NAME}"* ]]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
--
|
||||||
|
2.37.3
|
||||||
|
|
||||||
@ -1,113 +0,0 @@
|
|||||||
From 1e5c3a6b6f8722ebe120d56c4d010285d6bad3de Mon Sep 17 00:00:00 2001
|
|
||||||
From: Aravinda VK <aravinda@kadalu.tech>
|
|
||||||
Date: Sat, 17 Feb 2024 09:39:09 +0530
|
|
||||||
Subject: [PATCH] cli: Fix Hostname validation
|
|
||||||
|
|
||||||
Gluster volume create command fails to use the hostnames
|
|
||||||
that starts with `0.`
|
|
||||||
|
|
||||||
```
|
|
||||||
Please provide a valid hostname/ip other than localhost, 127.0.0.1 or
|
|
||||||
loopback address (0.0.0.0 to 0.255.255.255).
|
|
||||||
```
|
|
||||||
|
|
||||||
For example:
|
|
||||||
|
|
||||||
```
|
|
||||||
gluster volume create vol1 0.s1.dev:/data/gfs/vol1/b1 force
|
|
||||||
```
|
|
||||||
|
|
||||||
Signed-off-by: Aravinda VK <aravinda@kadalu.tech>
|
|
||||||
---
|
|
||||||
cli/src/cli-cmd-parser.c | 44 ++++++++++++++++++++++++----------------
|
|
||||||
1 file changed, 26 insertions(+), 18 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c
|
|
||||||
index 74e5ad7..7ff7652 100644
|
|
||||||
--- a/cli/src/cli-cmd-parser.c
|
|
||||||
+++ b/cli/src/cli-cmd-parser.c
|
|
||||||
@@ -87,6 +87,25 @@ validate_brick_name(char *brick)
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
+bool
|
|
||||||
+handle_local_or_loopback_address(char *host_name)
|
|
||||||
+{
|
|
||||||
+ int ip_len;
|
|
||||||
+ ip_len = strlen(host_name);
|
|
||||||
+
|
|
||||||
+ if (!(strcmp(host_name, "localhost") && strcmp(host_name, "127.0.0.1")) ||
|
|
||||||
+ (valid_ipv4_address(host_name, ip_len, 0) &&
|
|
||||||
+ !strncmp(host_name, "0.", 2))) {
|
|
||||||
+ cli_err(
|
|
||||||
+ "Please provide a valid hostname/ip other "
|
|
||||||
+ "than localhost, 127.0.0.1 or loopback "
|
|
||||||
+ "address (0.0.0.0 to 0.255.255.255).");
|
|
||||||
+ return _gf_false;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ return _gf_true;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
int32_t
|
|
||||||
cli_cmd_ta_brick_parse(const char **words, int wordcount, char **ta_brick)
|
|
||||||
{
|
|
||||||
@@ -128,15 +147,11 @@ cli_cmd_ta_brick_parse(const char **words, int wordcount, char **ta_brick)
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
- if (!(strcmp(host_name, "localhost") && strcmp(host_name, "127.0.0.1") &&
|
|
||||||
- strncmp(host_name, "0.", 2))) {
|
|
||||||
- cli_err(
|
|
||||||
- "Please provide a valid hostname/ip other "
|
|
||||||
- "than localhost, 127.0.0.1 or loopback "
|
|
||||||
- "address (0.0.0.0 to 0.255.255.255).");
|
|
||||||
+ if (!handle_local_or_loopback_address(host_name)) {
|
|
||||||
ret = -1;
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
+
|
|
||||||
if (!valid_internet_address(host_name, _gf_false, _gf_false)) {
|
|
||||||
cli_err(
|
|
||||||
"internet address '%s' does not conform to "
|
|
||||||
@@ -228,16 +243,12 @@ cli_cmd_bricks_parse(const char **words, int wordcount, int brick_index,
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
- if (!(strcmp(host_name, "localhost") &&
|
|
||||||
- strcmp(host_name, "127.0.0.1") && strncmp(host_name, "0.", 2))) {
|
|
||||||
- cli_err(
|
|
||||||
- "Please provide a valid hostname/ip other "
|
|
||||||
- "than localhost, 127.0.0.1 or loopback "
|
|
||||||
- "address (0.0.0.0 to 0.255.255.255).");
|
|
||||||
+ if (!handle_local_or_loopback_address(host_name)) {
|
|
||||||
ret = -1;
|
|
||||||
GF_FREE(tmp_host);
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
+
|
|
||||||
if (!valid_internet_address(host_name, _gf_false, _gf_false)) {
|
|
||||||
cli_err(
|
|
||||||
"internet address '%s' does not conform to "
|
|
||||||
@@ -3728,15 +3739,12 @@ extract_hostname_path_from_token(const char *tmp_words, char **hostname,
|
|
||||||
"memory");
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
- if (!(strcmp(host_name, "localhost") && strcmp(host_name, "127.0.0.1") &&
|
|
||||||
- strncmp(host_name, "0.", 2))) {
|
|
||||||
- cli_err(
|
|
||||||
- "Please provide a valid hostname/ip other "
|
|
||||||
- "than localhost, 127.0.0.1 or loopback "
|
|
||||||
- "address (0.0.0.0 to 0.255.255.255).");
|
|
||||||
+
|
|
||||||
+ if (!handle_local_or_loopback_address(host_name)) {
|
|
||||||
ret = -1;
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
+
|
|
||||||
if (!valid_internet_address(host_name, _gf_false, _gf_false)) {
|
|
||||||
cli_err(
|
|
||||||
"internet address '%s' does not conform to "
|
|
||||||
--
|
|
||||||
2.27.0
|
|
||||||
|
|
||||||
@ -1,40 +0,0 @@
|
|||||||
From 42e3cb18f5d1f9692615e55c82e7a7c83f0f3a04 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Anoop C S <anoopcs@cryptolab.net>
|
|
||||||
Date: Wed, 6 Dec 2023 16:32:24 +0530
|
|
||||||
Subject: [PATCH] mount.glusterfs: Remove `\` from grep command (#4275)
|
|
||||||
|
|
||||||
GNU grep v3.8 release notes[1] has the following mention about the usage
|
|
||||||
of backslahes:
|
|
||||||
|
|
||||||
"Regular expressions with stray backslashes now cause warnings, as their
|
|
||||||
unspecified behavior can lead to unexpected results."
|
|
||||||
|
|
||||||
As a result we see the warning "grep: warning: stray \ before -" during
|
|
||||||
script execution. Therefore remove the extra `\` from grep command.
|
|
||||||
|
|
||||||
Please note that this exact change was committed into mount_glusterfs.in
|
|
||||||
via 162d007dae167ec961b4a0970f6c37c6a2f9f641 but not here.
|
|
||||||
|
|
||||||
[1] https://savannah.gnu.org/forum/forum.php?forum_id=10227
|
|
||||||
|
|
||||||
Signed-off-by: Anoop C S <anoopcs@cryptolab.net>
|
|
||||||
---
|
|
||||||
xlators/mount/fuse/utils/mount.glusterfs.in | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/xlators/mount/fuse/utils/mount.glusterfs.in b/xlators/mount/fuse/utils/mount.glusterfs.in
|
|
||||||
index 6c9ff7a..c1cf17b 100755
|
|
||||||
--- a/xlators/mount/fuse/utils/mount.glusterfs.in
|
|
||||||
+++ b/xlators/mount/fuse/utils/mount.glusterfs.in
|
|
||||||
@@ -839,7 +839,7 @@ EOF
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- grep_ret=$(echo ${mount_point} | grep '^\-o');
|
|
||||||
+ grep_ret=$(echo ${mount_point} | grep '^-o');
|
|
||||||
[ "x" != "x${grep_ret}" ] && {
|
|
||||||
cat <<EOF >&2
|
|
||||||
ERROR: -o options cannot be specified in either first two arguments..
|
|
||||||
--
|
|
||||||
2.27.0
|
|
||||||
|
|
||||||
@ -1,63 +0,0 @@
|
|||||||
From 929d71b084e1e7f995d3a2884d16438108f6f621 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Erik Jacobson <erik.jacobson@hpe.com>
|
|
||||||
Date: Wed, 10 Apr 2024 06:45:02 -0500
|
|
||||||
Subject: [PATCH] prevent gnfs IO Errors on smaller files (#4322)
|
|
||||||
|
|
||||||
In certain situations, smaller files will report I/O errors when accessed
|
|
||||||
from NFS using Gluster NFS. With our settings, files up to 170M could report
|
|
||||||
this in some cases. It was not a consistent failure.
|
|
||||||
|
|
||||||
Disbling the NFS performance I/O cache seemed to work around the instances
|
|
||||||
of the problem observed for non-sharded volumes.
|
|
||||||
|
|
||||||
Research showed that gluster NFS is relying on an errno return value of
|
|
||||||
EINVAL to detect EOF and set is_eof. However, in some paths this value
|
|
||||||
was not retained or was reset to zero.
|
|
||||||
|
|
||||||
This change passes the errno along so it can be used by gluster NFS. We
|
|
||||||
found the issue in the shard xlator and the io-cache xlator.
|
|
||||||
|
|
||||||
Signed-off-by: Erik Jacobson <erikj@tdkt.org>
|
|
||||||
Co-authored-by: Erik Jacobson <erikj@sgi.com>
|
|
||||||
---
|
|
||||||
xlators/features/shard/src/shard.c | 5 ++++-
|
|
||||||
xlators/performance/io-cache/src/page.c | 4 +++-
|
|
||||||
2 files changed, 7 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/xlators/features/shard/src/shard.c b/xlators/features/shard/src/shard.c
|
|
||||||
index c902397..684d115 100644
|
|
||||||
--- a/xlators/features/shard/src/shard.c
|
|
||||||
+++ b/xlators/features/shard/src/shard.c
|
|
||||||
@@ -4931,8 +4931,11 @@ shard_readv_do_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
- if (local->op_ret >= 0)
|
|
||||||
+ if (local->op_ret >= 0) {
|
|
||||||
local->op_ret += op_ret;
|
|
||||||
+ /* gnfs requires op_errno to determine is_eof */
|
|
||||||
+ local->op_errno = op_errno;
|
|
||||||
+ }
|
|
||||||
|
|
||||||
shard_inode_ctx_get(anon_fd->inode, this, &ctx);
|
|
||||||
block_num = ctx->block_num;
|
|
||||||
diff --git a/xlators/performance/io-cache/src/page.c b/xlators/performance/io-cache/src/page.c
|
|
||||||
index 1ef25f7..57bd244 100644
|
|
||||||
--- a/xlators/performance/io-cache/src/page.c
|
|
||||||
+++ b/xlators/performance/io-cache/src/page.c
|
|
||||||
@@ -797,9 +797,11 @@ ioc_frame_unwind(call_frame_t *frame)
|
|
||||||
goto unwind;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ /* gnfs requires op_errno to determine is_eof */
|
|
||||||
+ op_errno = local->op_errno;
|
|
||||||
+
|
|
||||||
if (local->op_ret < 0) {
|
|
||||||
op_ret = local->op_ret;
|
|
||||||
- op_errno = local->op_errno;
|
|
||||||
goto unwind;
|
|
||||||
}
|
|
||||||
|
|
||||||
--
|
|
||||||
2.27.0
|
|
||||||
|
|
||||||
@ -1,110 +0,0 @@
|
|||||||
From a910f59d534e19bd6fca5aa0e47b40afbbfc7f56 Mon Sep 17 00:00:00 2001
|
|
||||||
From: chenjinhao <chen.jinhao@zte.com.cn>
|
|
||||||
Date: Mon, 22 Jul 2024 11:10:28 +0800
|
|
||||||
Subject: [PATCH] glusterd: fix memory leaks due to lack of GF_FREE
|
|
||||||
|
|
||||||
In glusterd-store.c, there are while loops like:
|
|
||||||
|
|
||||||
gf_store_iter_get_next(iter, &key, &value, &op_errno);
|
|
||||||
while (!ret) {
|
|
||||||
if (xx_condition) {
|
|
||||||
do_something();
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
GF_FREE(key);
|
|
||||||
GF_FREE(value);
|
|
||||||
key = NULL;
|
|
||||||
value = NULL;
|
|
||||||
|
|
||||||
ret = gf_store_iter_get_next(iter, &key, &value, &op_errno);
|
|
||||||
|
|
||||||
}
|
|
||||||
It's ok under normal case, howerver, once the condition does not meet
|
|
||||||
and the procedure goto 'out', there will be memory leak.
|
|
||||||
|
|
||||||
Hence, it is necessary to put a check at 'out'.
|
|
||||||
|
|
||||||
Similar leaks will be triggered in glusterd_store_retrieve_peers.
|
|
||||||
If no peerinfo is found, the procedure will goto the next loop.
|
|
||||||
It means memory previously allocated for key & value will be
|
|
||||||
leaked once gf_store_iter_get_next is called again in the next loop.
|
|
||||||
|
|
||||||
Signed-off-by: chenjinhao <chen.jinhao@zte.com.cn>
|
|
||||||
---
|
|
||||||
xlators/mgmt/glusterd/src/glusterd-store.c | 16 ++++++++++++++++
|
|
||||||
xlators/storage/posix/src/posix-helpers.c | 4 ++++
|
|
||||||
2 files changed, 20 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/xlators/mgmt/glusterd/src/glusterd-store.c b/xlators/mgmt/glusterd/src/glusterd-store.c
|
|
||||||
index 42d82d8..8594fc9 100644
|
|
||||||
--- a/xlators/mgmt/glusterd/src/glusterd-store.c
|
|
||||||
+++ b/xlators/mgmt/glusterd/src/glusterd-store.c
|
|
||||||
@@ -2364,6 +2364,10 @@ glusterd_store_retrieve_snapd(glusterd_volinfo_t *volinfo)
|
|
||||||
SLEN(GLUSTERD_STORE_KEY_SNAPD_PORT))) {
|
|
||||||
volinfo->snapd.port = atoi(value);
|
|
||||||
}
|
|
||||||
+ GF_FREE(key);
|
|
||||||
+ GF_FREE(value);
|
|
||||||
+ key = NULL;
|
|
||||||
+ value = NULL;
|
|
||||||
|
|
||||||
ret = gf_store_iter_get_next(iter, &key, &value, &op_errno);
|
|
||||||
}
|
|
||||||
@@ -2896,6 +2900,10 @@ glusterd_store_retrieve_bricks(glusterd_volinfo_t *volinfo)
|
|
||||||
ret = 0;
|
|
||||||
|
|
||||||
out:
|
|
||||||
+ if (key)
|
|
||||||
+ GF_FREE(key);
|
|
||||||
+ if (value)
|
|
||||||
+ GF_FREE(value);
|
|
||||||
if (gf_store_iter_destroy(&tmpiter)) {
|
|
||||||
gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_STORE_ITER_DESTROY_FAIL,
|
|
||||||
"Failed to destroy store iter");
|
|
||||||
@@ -3041,6 +3049,10 @@ out:
|
|
||||||
|
|
||||||
if (dup_value)
|
|
||||||
GF_FREE(dup_value);
|
|
||||||
+ if (key)
|
|
||||||
+ GF_FREE(key);
|
|
||||||
+ if (value)
|
|
||||||
+ GF_FREE(value);
|
|
||||||
if (ret) {
|
|
||||||
if (volinfo->rebal.dict)
|
|
||||||
dict_unref(volinfo->rebal.dict);
|
|
||||||
@@ -4633,6 +4645,10 @@ glusterd_store_retrieve_peers(xlator_t *this)
|
|
||||||
peerinfo = glusterd_peerinfo_new(GD_FRIEND_STATE_DEFAULT, NULL, NULL,
|
|
||||||
0);
|
|
||||||
if (peerinfo == NULL) {
|
|
||||||
+ GF_FREE(key);
|
|
||||||
+ GF_FREE(value);
|
|
||||||
+ key = NULL;
|
|
||||||
+ value = NULL;
|
|
||||||
ret = -1;
|
|
||||||
goto next;
|
|
||||||
}
|
|
||||||
diff --git a/xlators/storage/posix/src/posix-helpers.c b/xlators/storage/posix/src/posix-helpers.c
|
|
||||||
index 08bb4ac..9fae102 100644
|
|
||||||
--- a/xlators/storage/posix/src/posix-helpers.c
|
|
||||||
+++ b/xlators/storage/posix/src/posix-helpers.c
|
|
||||||
@@ -3288,6 +3288,8 @@ posix_cs_set_state(xlator_t *this, dict_t **rsp, gf_cs_obj_state state,
|
|
||||||
xattrsize = sys_fgetxattr(*fd, GF_CS_OBJECT_REMOTE, value,
|
|
||||||
xattrsize + 1);
|
|
||||||
if (xattrsize == -1) {
|
|
||||||
+ if (value)
|
|
||||||
+ GF_FREE(value);
|
|
||||||
gf_msg(this->name, GF_LOG_ERROR, 0, errno,
|
|
||||||
" getxattr failed for key %s", GF_CS_OBJECT_REMOTE);
|
|
||||||
goto out;
|
|
||||||
@@ -3311,6 +3313,8 @@ posix_cs_set_state(xlator_t *this, dict_t **rsp, gf_cs_obj_state state,
|
|
||||||
xattrsize = sys_lgetxattr(path, GF_CS_OBJECT_REMOTE, value,
|
|
||||||
xattrsize + 1);
|
|
||||||
if (xattrsize == -1) {
|
|
||||||
+ if (value)
|
|
||||||
+ GF_FREE(value);
|
|
||||||
gf_msg(this->name, GF_LOG_ERROR, 0, errno,
|
|
||||||
" getxattr failed for key %s", GF_CS_OBJECT_REMOTE);
|
|
||||||
goto out;
|
|
||||||
--
|
|
||||||
2.33.0
|
|
||||||
|
|
||||||
@ -1,112 +0,0 @@
|
|||||||
From b9a37a2366bbfddd47da81bb86df97a9e6431d85 Mon Sep 17 00:00:00 2001
|
|
||||||
From: chenjinhao <chen.jinhao@zte.com.cn>
|
|
||||||
Date: Mon, 22 Jul 2024 11:15:58 +0800
|
|
||||||
Subject: [PATCH] glusterd: fix memory leaks detected by asan
|
|
||||||
MIME-Version: 1.0
|
|
||||||
Content-Type: text/plain; charset=UTF-8
|
|
||||||
Content-Transfer-Encoding: 8bit
|
|
||||||
|
|
||||||
Memory leaks detected by setting --enable-asan, compile, install
|
|
||||||
and run gluster cmds, such as gluster v create/start/stop, etc.
|
|
||||||
|
|
||||||
Direct leak of 11430 byte(s) in 150 object(s) allocated from:
|
|
||||||
#0 0x7f59844efbb8 in __interceptor_malloc (/lib64/libasan.so.5+0xefbb8)
|
|
||||||
#1 0x7f5983aeb96d in __gf_malloc (/lib64/libglusterfs.so.0+0xeb96d)
|
|
||||||
#2 0x7f59775b569b in glusterd_store_update_volinfo ../../../../libglusterfs/src/glusterfs/mem-pool.h:170
|
|
||||||
#3 0x7f59775be3b5 in glusterd_store_retrieve_volume glusterd-store.c:3334
|
|
||||||
#4 0x7f59775bf076 in glusterd_store_retrieve_volumes glusterd-store.c:3571
|
|
||||||
#5 0x7f59775bfc9e in glusterd_restore glusterd-store.c:4913
|
|
||||||
#6 0x7f59774ca5a1 (/usr/lib64/glusterfs/8.2/xlator/mgmt/glusterd.so+0xca5a1)
|
|
||||||
#7 0x7f5983a7cb6b in __xlator_init xlator.c:594
|
|
||||||
#8 0x7f5983b0c5d0 in glusterfs_graph_init graph.c:422
|
|
||||||
#9 0x7f5983b0d422 in glusterfs_graph_activate (/lib64/libglusterfs.so.0+0x10d422)
|
|
||||||
#10 0x5605f2e1eff5 in glusterfs_process_volfp glusterfsd.c:2506
|
|
||||||
#11 0x5605f2e1f238 in glusterfs_volumes_init glusterfsd.c:2577
|
|
||||||
#12 0x5605f2e15d8d in main (/usr/sbin/glusterfsd+0x15d8d)
|
|
||||||
#13 0x7f598103acf2 in __libc_start_main (/lib64/libc.so.6+0x3acf2)
|
|
||||||
#14 0x5605f2e162cd in _start (/usr/sbin/glusterfsd+0x162cd)
|
|
||||||
In glusterd_store_update_volinfo, memory will be leaked when the dynamic memory is put
|
|
||||||
into a dict by calling dict_set_str:
|
|
||||||
ret = dict_set_str(volinfo->dict, key, gf_strdup(value));
|
|
||||||
|
|
||||||
Direct leak of 3351 byte(s) in 30 object(s) allocated from:
|
|
||||||
#0 0x7f59844efbb8 in __interceptor_malloc (/lib64/libasan.so.5+0xefbb8)
|
|
||||||
#1 0x7f5983aeb96d in __gf_malloc (/lib64/libglusterfs.so.0+0xeb96d)
|
|
||||||
#2 0x7f59775541e7 in glusterd_is_path_in_use ../../../../libglusterfs/src/glusterfs/mem-pool.h:170
|
|
||||||
#3 0x7f59775541e7 in glusterd_check_and_set_brick_xattr glusterd-utils.c:8203
|
|
||||||
#4 0x7f5977554d7c in glusterd_validate_and_create_brickpath glusterd-utils.c:1549
|
|
||||||
#5 0x7f5977645fcb in glusterd_op_stage_create_volume glusterd-volume-ops.c:1260
|
|
||||||
#6 0x7f5977519025 in glusterd_op_stage_validate glusterd-op-sm.c:5787
|
|
||||||
#7 0x7f5977672555 in gd_stage_op_phase glusterd-syncop.c:1297
|
|
||||||
#8 0x7f5977676db0 in gd_sync_task_begin glusterd-syncop.c:1951
|
|
||||||
#9 0x7f59776775dc in glusterd_op_begin_synctask glusterd-syncop.c:2016
|
|
||||||
#10 0x7f5977642bd6 in __glusterd_handle_create_volume glusterd-volume-ops.c:506
|
|
||||||
#11 0x7f59774e27b1 in glusterd_big_locked_handler glusterd-handler.c:83
|
|
||||||
#12 0x7f5983b14cac in synctask_wrap syncop.c:353
|
|
||||||
#13 0x7f59810240af (/lib64/libc.so.6+0x240af)
|
|
||||||
During volume creation, glusterd_is_path_in_use will be called to check brick path reuse.
|
|
||||||
Under normal circumstances, there is no problem, however, when a `force` cmd is given during
|
|
||||||
volume creation and the futher sys_lsetxattr failed, the memory area previously pointed by
|
|
||||||
*op_errstr will be leakd, cause:
|
|
||||||
out:
|
|
||||||
if (strlen(msg))
|
|
||||||
*op_errstr = gf_strdup(msg);
|
|
||||||
|
|
||||||
Similar leak also exists in posix_cs_set_state:
|
|
||||||
value = GF_CALLOC(1, xattrsize + 1, gf_posix_mt_char);
|
|
||||||
...
|
|
||||||
dict_set_str_sizen(*rsp, GF_CS_OBJECT_REMOTE, value);
|
|
||||||
|
|
||||||
Signed-off-by: chenjinhao <chen.jinhao@zte.com.cn>
|
|
||||||
---
|
|
||||||
xlators/mgmt/glusterd/src/glusterd-store.c | 2 +-
|
|
||||||
xlators/mgmt/glusterd/src/glusterd-utils.c | 5 ++++-
|
|
||||||
xlators/storage/posix/src/posix-helpers.c | 2 +-
|
|
||||||
3 files changed, 6 insertions(+), 3 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/xlators/mgmt/glusterd/src/glusterd-store.c b/xlators/mgmt/glusterd/src/glusterd-store.c
|
|
||||||
index 8594fc9..ce3d7a4 100644
|
|
||||||
--- a/xlators/mgmt/glusterd/src/glusterd-store.c
|
|
||||||
+++ b/xlators/mgmt/glusterd/src/glusterd-store.c
|
|
||||||
@@ -3295,7 +3295,7 @@ glusterd_store_update_volinfo(glusterd_volinfo_t *volinfo)
|
|
||||||
*/
|
|
||||||
if (!strcmp(key, "features.limit-usage"))
|
|
||||||
break;
|
|
||||||
- ret = dict_set_str(volinfo->dict, key, gf_strdup(value));
|
|
||||||
+ ret = dict_set_dynstr(volinfo->dict, key, gf_strdup(value));
|
|
||||||
if (ret) {
|
|
||||||
gf_msg(this->name, GF_LOG_ERROR, 0,
|
|
||||||
GD_MSG_DICT_SET_FAILED,
|
|
||||||
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
|
|
||||||
index 72352ce..e255e99 100644
|
|
||||||
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
|
|
||||||
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
|
|
||||||
@@ -7754,8 +7754,11 @@ glusterd_check_and_set_brick_xattr(char *host, char *path, uuid_t uuid,
|
|
||||||
|
|
||||||
ret = 0;
|
|
||||||
out:
|
|
||||||
- if (strlen(msg))
|
|
||||||
+ if (strlen(msg)) {
|
|
||||||
+ if (*op_errstr)
|
|
||||||
+ GF_FREE(*op_errstr);
|
|
||||||
*op_errstr = gf_strdup(msg);
|
|
||||||
+ }
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
diff --git a/xlators/storage/posix/src/posix-helpers.c b/xlators/storage/posix/src/posix-helpers.c
|
|
||||||
index 9fae102..df3ed73 100644
|
|
||||||
--- a/xlators/storage/posix/src/posix-helpers.c
|
|
||||||
+++ b/xlators/storage/posix/src/posix-helpers.c
|
|
||||||
@@ -3329,7 +3329,7 @@ posix_cs_set_state(xlator_t *this, dict_t **rsp, gf_cs_obj_state state,
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ret == 0) {
|
|
||||||
- ret = dict_set_str_sizen(*rsp, GF_CS_OBJECT_REMOTE, value);
|
|
||||||
+ ret = dict_set_dynstr_sizen(*rsp, GF_CS_OBJECT_REMOTE, value);
|
|
||||||
if (ret) {
|
|
||||||
gf_msg(this->name, GF_LOG_ERROR, 0, 0,
|
|
||||||
"failed to set"
|
|
||||||
--
|
|
||||||
2.33.0
|
|
||||||
|
|
||||||
Binary file not shown.
@ -223,8 +223,8 @@
|
|||||||
##
|
##
|
||||||
Summary: Distributed File System
|
Summary: Distributed File System
|
||||||
Name: glusterfs
|
Name: glusterfs
|
||||||
Version: 11.1
|
Version: 10.3
|
||||||
Release: 5
|
Release: 2
|
||||||
License: GPLv3 or GPLv2+ or LGPLv3+
|
License: GPLv3 or GPLv2+ or LGPLv3+
|
||||||
URL: http://docs.gluster.org/
|
URL: http://docs.gluster.org/
|
||||||
%if ( 0%{_for_fedora_koji_builds} )
|
%if ( 0%{_for_fedora_koji_builds} )
|
||||||
@ -234,15 +234,11 @@ Source2: glusterfsd.sysconfig
|
|||||||
Source7: glusterfsd.service
|
Source7: glusterfsd.service
|
||||||
Source8: glusterfsd.init
|
Source8: glusterfsd.init
|
||||||
%else
|
%else
|
||||||
Source0: https://download.gluster.org/pub/gluster/glusterfs/11/%{version}/%{name}-%{version}.tar.gz
|
Source0: https://download.gluster.org/pub/gluster/glusterfs/10/%{version}/%{name}-%{version}.tar.gz
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
Patch1: 0001-fuse-Resolve-asan-bug-in-during-receive-event-notifi.patch
|
Patch1: 0001-SC2081-can-t-match-globs-Use-or-grep.patch
|
||||||
Patch2: 0002-fix-Hostname-validation.patch
|
Patch2: 0002-fuse-Resolve-asan-bug-in-during-receive-event-notifi.patch
|
||||||
Patch3: 0003-fix-mount.glusterfs-Remove-from-grep-command.patch
|
|
||||||
Patch4: 0004-prevent-gnfs-IO-Errors-on-smaller-files.patch
|
|
||||||
Patch5: 0005-glusterd-fix-memory-leaks-due-to-lack-of-GF_FREE.patch
|
|
||||||
Patch6: 0006-glusterd-fix-memory-leaks-detected-by-asan.patch
|
|
||||||
|
|
||||||
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
|
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
|
||||||
BuildRequires: rpcgen gperftools-devel libunwind-devel
|
BuildRequires: rpcgen gperftools-devel libunwind-devel
|
||||||
@ -330,6 +326,7 @@ and client framework.
|
|||||||
%package cli
|
%package cli
|
||||||
Summary: GlusterFS CLI
|
Summary: GlusterFS CLI
|
||||||
Requires: libglusterfs0%{?_isa} = %{version}-%{release}
|
Requires: libglusterfs0%{?_isa} = %{version}-%{release}
|
||||||
|
Requires: libglusterd0%{?_isa} = %{version}-%{release}
|
||||||
|
|
||||||
%description cli
|
%description cli
|
||||||
GlusterFS is a distributed file-system capable of scaling to several
|
GlusterFS is a distributed file-system capable of scaling to several
|
||||||
@ -453,8 +450,6 @@ Requires: libgfrpc0%{?_isa} = %{version}-%{release}
|
|||||||
Requires: libgfxdr0%{?_isa} = %{version}-%{release}
|
Requires: libgfxdr0%{?_isa} = %{version}-%{release}
|
||||||
Obsoletes: %{name}-libs <= %{version}-%{release}
|
Obsoletes: %{name}-libs <= %{version}-%{release}
|
||||||
Provides: %{name}-libs = %{version}-%{release}
|
Provides: %{name}-libs = %{version}-%{release}
|
||||||
Obsoletes: libglusterd0 = %{version}-%{release}
|
|
||||||
Provides: libglusterd0 = %{version}-%{release}
|
|
||||||
|
|
||||||
%description -n libglusterfs0
|
%description -n libglusterfs0
|
||||||
GlusterFS is a distributed file-system capable of scaling to several
|
GlusterFS is a distributed file-system capable of scaling to several
|
||||||
@ -607,6 +602,21 @@ Much of the code in GlusterFS is in user space and easily manageable.
|
|||||||
|
|
||||||
This package provides libgfxdr.so.
|
This package provides libgfxdr.so.
|
||||||
|
|
||||||
|
%package -n libglusterd0
|
||||||
|
Summary: GlusterFS libglusterd library
|
||||||
|
Requires: libglusterfs0%{?_isa} = %{version}-%{release}
|
||||||
|
Obsoletes: %{name}-libs <= %{version}-%{release}
|
||||||
|
|
||||||
|
%description -n libglusterd0
|
||||||
|
GlusterFS is a distributed file-system capable of scaling to several
|
||||||
|
petabytes. It aggregates various storage bricks over TCP/IP interconnect
|
||||||
|
into one large parallel network filesystem. GlusterFS is one of the
|
||||||
|
most sophisticated file systems in terms of features and extensibility.
|
||||||
|
It borrows a powerful concept called Translators from GNU Hurd kernel.
|
||||||
|
Much of the code in GlusterFS is in user space and easily manageable.
|
||||||
|
|
||||||
|
This package provides the libglusterd library
|
||||||
|
|
||||||
%package -n python%{_pythonver}-gluster
|
%package -n python%{_pythonver}-gluster
|
||||||
Summary: GlusterFS python library
|
Summary: GlusterFS python library
|
||||||
Requires: python%{_pythonver}
|
Requires: python%{_pythonver}
|
||||||
@ -756,13 +766,6 @@ GlusterFS Events
|
|||||||
|
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%package help
|
|
||||||
Summary: Including man files for glusterfs.
|
|
||||||
Requires: man
|
|
||||||
|
|
||||||
%description help
|
|
||||||
This contains man files for the using of glusterfs.
|
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -n %{name}-%{version}%{?prereltag} -p1
|
%autosetup -n %{name}-%{version}%{?prereltag} -p1
|
||||||
%if ( ! %{_usepython3} )
|
%if ( ! %{_usepython3} )
|
||||||
@ -959,6 +962,9 @@ exit 0
|
|||||||
%post -n libgfxdr0
|
%post -n libgfxdr0
|
||||||
/sbin/ldconfig
|
/sbin/ldconfig
|
||||||
|
|
||||||
|
%post -n libglusterd0
|
||||||
|
/sbin/ldconfig
|
||||||
|
|
||||||
%if ( 0%{!?_without_server:1} )
|
%if ( 0%{!?_without_server:1} )
|
||||||
%post server
|
%post server
|
||||||
# Legacy server
|
# Legacy server
|
||||||
@ -1107,6 +1113,10 @@ exit 0
|
|||||||
##
|
##
|
||||||
%files
|
%files
|
||||||
%doc ChangeLog COPYING-GPLV2 COPYING-LGPLV3 INSTALL README.md THANKS COMMITMENT
|
%doc ChangeLog COPYING-GPLV2 COPYING-LGPLV3 INSTALL README.md THANKS COMMITMENT
|
||||||
|
%{_mandir}/man8/*gluster*.8*
|
||||||
|
%if ( 0%{!?_without_server:1} )
|
||||||
|
%exclude %{_mandir}/man8/gluster.8*
|
||||||
|
%endif
|
||||||
%dir %{_localstatedir}/log/glusterfs
|
%dir %{_localstatedir}/log/glusterfs
|
||||||
%if 0%{?!_without_server:1}
|
%if 0%{?!_without_server:1}
|
||||||
%dir %{_datadir}/glusterfs
|
%dir %{_datadir}/glusterfs
|
||||||
@ -1174,7 +1184,8 @@ exit 0
|
|||||||
|
|
||||||
%files cli
|
%files cli
|
||||||
%{_sbindir}/gluster
|
%{_sbindir}/gluster
|
||||||
%{_sysconfdir}/bash_completion.d/gluster*
|
%{_mandir}/man8/gluster.8*
|
||||||
|
%{_sysconfdir}/bash_completion.d/gluster
|
||||||
|
|
||||||
%files cloudsync-plugins
|
%files cloudsync-plugins
|
||||||
%dir %{_libdir}/glusterfs/%{version}%{?prereltag}/cloudsync-plugins
|
%dir %{_libdir}/glusterfs/%{version}%{?prereltag}/cloudsync-plugins
|
||||||
@ -1311,6 +1322,10 @@ exit 0
|
|||||||
%files -n libgfxdr0
|
%files -n libgfxdr0
|
||||||
%{_libdir}/libgfxdr.so.*
|
%{_libdir}/libgfxdr.so.*
|
||||||
|
|
||||||
|
%files -n libglusterd0
|
||||||
|
%{_libdir}/libglusterd.so.*
|
||||||
|
%exclude %{_libdir}/libglusterd.so
|
||||||
|
|
||||||
%files -n python%{_pythonver}-gluster
|
%files -n python%{_pythonver}-gluster
|
||||||
# introducing glusterfs module in site packages.
|
# introducing glusterfs module in site packages.
|
||||||
# so that all other gluster submodules can reside in the same namespace.
|
# so that all other gluster submodules can reside in the same namespace.
|
||||||
@ -1366,6 +1381,9 @@ exit 0
|
|||||||
# symlink. The binary itself (and symlink) are part of the glusterfs-fuse
|
# symlink. The binary itself (and symlink) are part of the glusterfs-fuse
|
||||||
# package, because glusterfs-server depends on that anyway.
|
# package, because glusterfs-server depends on that anyway.
|
||||||
|
|
||||||
|
# Manpages
|
||||||
|
%{_mandir}/man8/gluster-setgfid2path.8*
|
||||||
|
|
||||||
# xlators
|
# xlators
|
||||||
%dir %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator
|
%dir %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator
|
||||||
%dir %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/features
|
%dir %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/features
|
||||||
@ -1378,7 +1396,6 @@ exit 0
|
|||||||
%{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/features/posix*
|
%{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/features/posix*
|
||||||
%{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/features/snapview-server.so
|
%{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/features/snapview-server.so
|
||||||
%{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/features/marker.so
|
%{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/features/marker.so
|
||||||
%{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/features/simple-quota.so
|
|
||||||
%{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/features/quota*
|
%{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/features/quota*
|
||||||
%{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/features/selinux.so
|
%{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/features/selinux.so
|
||||||
%{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/features/trash.so
|
%{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/features/trash.so
|
||||||
@ -1501,36 +1518,7 @@ exit 0
|
|||||||
%endif
|
%endif
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%files help
|
|
||||||
%{_mandir}/man8/*gluster*.8*
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Mon Jul 22 2024 cenhuilin <cenhuilin@kylinos.cn> - 11.1-5
|
|
||||||
- glusterd: fix memory leak in glusterd
|
|
||||||
|
|
||||||
* Wed Jun 19 2024 zhangyaqi <zhangyaqi@kylinos.cn> - 11.1-4
|
|
||||||
- fix prevent gnfs IO Errors on smaller files
|
|
||||||
|
|
||||||
* Wed May 22 2024 xuchenchen <xuchenchen@kylinos.cn> - 11.1-3
|
|
||||||
- fix Hostname validation
|
|
||||||
- fix mount.glusterfs Remove \ from grep command
|
|
||||||
|
|
||||||
* Wed Mar 13 2024 wangxiaomeng <wangxiaomeng@kylinos.cn> - 11.1-2
|
|
||||||
- fix upgrade error that %{_mandir}/man8/*gluster*.8* belong to package glusterfs currently conflict with that belong to package help in the lower version.
|
|
||||||
|
|
||||||
* Sat Jan 27 2024 wuguanghao <wuguanghao3@huawei.com> - 11.1-1
|
|
||||||
- upgrade to 11.1
|
|
||||||
- add simple-quota xattr to afr and ec ignore list
|
|
||||||
- fix asan use-after-free bug
|
|
||||||
- fix error not supported for ipv6
|
|
||||||
- support OpenSSL 3.0
|
|
||||||
- drop libglusterd
|
|
||||||
- O_PATH support over protocol
|
|
||||||
- Enable AES cipher for SSL by default
|
|
||||||
- glusterd: add stripe_count in volume info
|
|
||||||
- snapshots: Support for ZFS Snapshots
|
|
||||||
- gfapi: Add support for 'AT_EMPTY_PATH' and 'AT_REMOVEDIR' flag
|
|
||||||
|
|
||||||
* Thu Mar 9 2023 wuguanghao <wuguanghao3@huawei.com> - 10.3-2
|
* Thu Mar 9 2023 wuguanghao <wuguanghao3@huawei.com> - 10.3-2
|
||||||
- fix CVE-2023-26253
|
- fix CVE-2023-26253
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user