From 312c9bafe12c8e99cb5a129c2ae78c5c7e398e93 Mon Sep 17 00:00:00 2001 From: Milind Changire Date: Wed, 9 May 2018 08:42:05 -0400 Subject: [PATCH] autobuild v3.12.2-9 Resolves: bz#1546717 bz#1557551 bz#1558948 bz#1561999 bz#1563804 Resolves: bz#1565015 bz#1565119 bz#1565399 bz#1565577 bz#1567100 Resolves: bz#1567899 bz#1568374 bz#1568969 bz#1569490 bz#1570514 Resolves: bz#1570541 bz#1570582 bz#1571645 bz#1572087 bz#1572585 Resolves: bz#1575895 Signed-off-by: Milind Changire --- ...luster-dht-Fix-dht_rename-lock-order.patch | 117 ++ ...ailed-due-to-access-rpc-refcount-in-.patch | 39 + 0239-geo-rep-Fix-syncing-of-symlink.patch | 54 + ...revent-mounting-shared-storage-from-.patch | 72 ++ ...add-option-for-strict-authentication.patch | 283 +++++ ...ure-changelog-remove-unused-variable.patch | 31 + ...mer-Fix-possible-race-during-cleanup.patch | 86 ++ ...atd-related-files-need-to-be-owned-b.patch | 93 ++ ...ke-RHGS-version-available-for-server.patch | 56 + ...-for-memory-leak-in-get-state-detail.patch | 45 + ...ocol-server-unwind-as-per-op-version.patch | 74 ++ ...ache-purge-cache-on-ENOENT-ESTALE-er.patch | 1042 +++++++++++++++++ ...nd-if-dht_selfheal_dir_mkdir-returns.patch | 46 + ...as-passthrough-for-renames-on-single.patch | 69 ++ ...ttle_hash-should-ignore-ENOENT-and-E.patch | 52 + ...-Skip-non-ganesha-nodes-properly-for.patch | 60 + 0253-geo-rep-Fix-upgrade-issue.patch | 59 + ...-Avoid-changelog-retries-for-geo-rep.patch | 99 ++ ...-update-listen-backlog-value-to-1024.patch | 46 + ...rpc-set-listen-backlog-to-high-value.patch | 57 + 0257-rpc-rearm-listener-socket-early.patch | 57 + ...error-only-if-layout-healing-is-requ.patch | 286 +++++ ...on-ssl-for-crawler-clients-if-needed.patch | 78 ++ ...-log-flooding-for-internal-MDS-xattr.patch | 44 + glusterfs.spec | 37 +- 25 files changed, 2981 insertions(+), 1 deletion(-) create mode 100644 0237-cluster-dht-Fix-dht_rename-lock-order.patch create mode 100644 0238-quota-Build-is-failed-due-to-access-rpc-refcount-in-.patch create mode 100644 0239-geo-rep-Fix-syncing-of-symlink.patch create mode 100644 0240-shared-storage-Prevent-mounting-shared-storage-from-.patch create mode 100644 0241-server-auth-add-option-for-strict-authentication.patch create mode 100644 0242-feature-changelog-remove-unused-variable.patch create mode 100644 0243-timer-Fix-possible-race-during-cleanup.patch create mode 100644 0244-common-ha-All-statd-related-files-need-to-be-owned-b.patch create mode 100644 0245-build-make-RHGS-version-available-for-server.patch create mode 100644 0246-glusterd-Fix-for-memory-leak-in-get-state-detail.patch create mode 100644 0247-protocol-server-unwind-as-per-op-version.patch create mode 100644 0248-performance-md-cache-purge-cache-on-ENOENT-ESTALE-er.patch create mode 100644 0249-cluster-dht-unwind-if-dht_selfheal_dir_mkdir-returns.patch create mode 100644 0250-cluster-dht-act-as-passthrough-for-renames-on-single.patch create mode 100644 0251-dht-gf_defrag_settle_hash-should-ignore-ENOENT-and-E.patch create mode 100644 0252-glusterd-ganesha-Skip-non-ganesha-nodes-properly-for.patch create mode 100644 0253-geo-rep-Fix-upgrade-issue.patch create mode 100644 0254-posix-Avoid-changelog-retries-for-geo-rep.patch create mode 100644 0255-glusterd-update-listen-backlog-value-to-1024.patch create mode 100644 0256-rpc-set-listen-backlog-to-high-value.patch create mode 100644 0257-rpc-rearm-listener-socket-early.patch create mode 100644 0258-cluster-dht-log-error-only-if-layout-healing-is-requ.patch create mode 100644 0259-Quota-Turn-on-ssl-for-crawler-clients-if-needed.patch create mode 100644 0260-dht-Avoid-dict-log-flooding-for-internal-MDS-xattr.patch diff --git a/0237-cluster-dht-Fix-dht_rename-lock-order.patch b/0237-cluster-dht-Fix-dht_rename-lock-order.patch new file mode 100644 index 0000000..bde2b8e --- /dev/null +++ b/0237-cluster-dht-Fix-dht_rename-lock-order.patch @@ -0,0 +1,117 @@ +From 67c89f4fc9a80c9ed4a7d78df57c1ca76f4adc3d Mon Sep 17 00:00:00 2001 +From: N Balachandran +Date: Tue, 17 Apr 2018 15:37:05 +0530 +Subject: [PATCH 237/260] cluster/dht: Fix dht_rename lock order + +Fixed dht_order_rename_lock to use the same inodelk ordering +as that of the dht selfheal locks (dictionary order of +lock subvolumes). + +upstream: https://review.gluster.org/#/c/19886/ + +> Change-Id: Ia3f8353b33ea2fd3bc1ba7e8e777dda6c1d33e0d +> fixes: bz#1568348 +> Signed-off-by: N Balachandran + +Change-Id: I09022705f5b77af0f50a2bab4579d4d3cb902155 +BUG: 1565119 +Signed-off-by: N Balachandran +Reviewed-on: https://code.engineering.redhat.com/gerrit/136451 +Tested-by: RHGS Build Bot +Reviewed-by: Sunil Kumar Heggodu Gopala Acharya +--- + xlators/cluster/dht/src/dht-rename.c | 65 ++++++++++++++++++++++++++---------- + 1 file changed, 47 insertions(+), 18 deletions(-) + +diff --git a/xlators/cluster/dht/src/dht-rename.c b/xlators/cluster/dht/src/dht-rename.c +index 3068499..ca6b5f4 100644 +--- a/xlators/cluster/dht/src/dht-rename.c ++++ b/xlators/cluster/dht/src/dht-rename.c +@@ -490,37 +490,66 @@ err: + return 0; + } + ++ ++/* ++ * If the hashed subvolumes of both source and dst are the different, ++ * lock in dictionary order of hashed subvol->name. This is important ++ * in case the parent directory is the same for both src and dst to ++ * prevent inodelk deadlocks when racing with a fix-layout op on the parent. ++ * ++ * If the hashed subvols are the same, use the gfid/name to determine ++ * the order of taking locks to prevent entrylk deadlocks when the parent ++ * dirs are the same. ++ * ++ */ + static void + dht_order_rename_lock (call_frame_t *frame, loc_t **loc, xlator_t **subvol) + { +- dht_local_t *local = NULL; +- char src[GF_UUID_BNAME_BUF_SIZE] = {0}; +- char dst[GF_UUID_BNAME_BUF_SIZE] = {0}; ++ int ret = 0; ++ dht_local_t *local = NULL; ++ char src[GF_UUID_BNAME_BUF_SIZE] = {0}; ++ char dst[GF_UUID_BNAME_BUF_SIZE] = {0}; ++ + + local = frame->local; + +- if (local->loc.pargfid) +- uuid_utoa_r (local->loc.pargfid, src); +- else if (local->loc.parent) +- uuid_utoa_r (local->loc.parent->gfid, src); ++ if (local->src_hashed->name == local->dst_hashed->name) { ++ ret = 0; ++ } else { ++ ret = strcmp (local->src_hashed->name, local->dst_hashed->name); ++ } + +- strcat (src, local->loc.name); ++ if (ret == 0) { + +- if (local->loc2.pargfid) +- uuid_utoa_r (local->loc2.pargfid, dst); +- else if (local->loc2.parent) +- uuid_utoa_r (local->loc2.parent->gfid, dst); ++ /* hashed subvols are the same for src and dst */ ++ /* Entrylks need to be ordered*/ ++ if (local->loc.pargfid) ++ uuid_utoa_r (local->loc.pargfid, src); ++ else if (local->loc.parent) ++ uuid_utoa_r (local->loc.parent->gfid, src); + +- strcat (dst, local->loc2.name); ++ strcat (src, local->loc.name); + +- if (strcmp(src, dst) > 0) { +- local->current = &local->lock[1]; +- *loc = &local->loc2; +- *subvol = local->dst_hashed; +- } else { ++ if (local->loc2.pargfid) ++ uuid_utoa_r (local->loc2.pargfid, dst); ++ else if (local->loc2.parent) ++ uuid_utoa_r (local->loc2.parent->gfid, dst); ++ ++ strcat (dst, local->loc2.name); ++ ret = strcmp (src, dst); ++ } ++ ++ if (ret <= 0) { ++ /*inodelk in dictionary order of hashed subvol names*/ ++ /*entrylk in dictionary order of gfid/basename */ + local->current = &local->lock[0]; + *loc = &local->loc; + *subvol = local->src_hashed; ++ ++ } else { ++ local->current = &local->lock[1]; ++ *loc = &local->loc2; ++ *subvol = local->dst_hashed; + } + + return; +-- +1.8.3.1 + diff --git a/0238-quota-Build-is-failed-due-to-access-rpc-refcount-in-.patch b/0238-quota-Build-is-failed-due-to-access-rpc-refcount-in-.patch new file mode 100644 index 0000000..e1d1ed2 --- /dev/null +++ b/0238-quota-Build-is-failed-due-to-access-rpc-refcount-in-.patch @@ -0,0 +1,39 @@ +From 0b61a3b9c948a55da0df51a64483dcb8bc3954ba Mon Sep 17 00:00:00 2001 +From: moagrawa +Date: Mon, 23 Apr 2018 15:12:19 +0530 +Subject: [PATCH 238/260] quota: Build is failed due to access rpc->refcount in + wrong way + +Problem: Build is failed on centos due to access rpc-refcount + in wrong way in quota.c + +Solution: Update quota.c to access rpc->refcount + +BUG: 1570582 +Change-Id: I881617259f73a7b1430e0ea80adf11168356d41e +Signed-off-by: moagrawa +Reviewed-on: https://code.engineering.redhat.com/gerrit/136505 +Tested-by: RHGS Build Bot +Reviewed-by: Atin Mukherjee +--- + xlators/features/quota/src/quota.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/xlators/features/quota/src/quota.c b/xlators/features/quota/src/quota.c +index c4817bc..3d68ffa 100644 +--- a/xlators/features/quota/src/quota.c ++++ b/xlators/features/quota/src/quota.c +@@ -5259,7 +5259,9 @@ fini (xlator_t *this) + priv->rpc_clnt = NULL; + this->private = NULL; + if (rpc) { +- cnt = GF_ATOMIC_GET (rpc->refcount); ++ pthread_mutex_lock (&rpc->lock); ++ cnt = rpc->refcount; ++ pthread_mutex_unlock (&rpc->lock); + for (i = 0; i < cnt; i++) + rpc_clnt_unref (rpc); + } +-- +1.8.3.1 + diff --git a/0239-geo-rep-Fix-syncing-of-symlink.patch b/0239-geo-rep-Fix-syncing-of-symlink.patch new file mode 100644 index 0000000..d7c09fd --- /dev/null +++ b/0239-geo-rep-Fix-syncing-of-symlink.patch @@ -0,0 +1,54 @@ +From 80087936cf49a08848ee054179e4044ef42cd29e Mon Sep 17 00:00:00 2001 +From: Kotresh HR +Date: Fri, 13 Apr 2018 10:52:14 -0400 +Subject: [PATCH 239/260] geo-rep: Fix syncing of symlink + +Problem: +If symlink is created on master pointing +to current directory (e.g symlink -> ".") with +non root uid or gid, geo-rep worker crashes +with ENOTSUP. + +Cause: +Geo-rep creates the symlink on slave and +fixes the uid and gid using chown cmd. +os.chown dereferences the symlink which is +pointing to ".gfid" which is not supported. +Note that geo-rep operates on aux-gfid-mount +(e.g. "/mnt/.gfid/"). + +Solution: +The uid or gid change is acutally on symlink +file. So use os.lchown, i.e, don't deference. + +Upstream Reference +> BUG: 1567209 +> Change-Id: I63575fc589d71f987bef1d350c030987738c78ad +> Patch: https://review.gluster.org/19872 + +BUG: 1565399 +Change-Id: Ib4613719ac735a4e2856bc0655351f69f2467dac +Signed-off-by: Kotresh HR +Reviewed-on: https://code.engineering.redhat.com/gerrit/136820 +Tested-by: RHGS Build Bot +Reviewed-by: Atin Mukherjee +--- + geo-replication/syncdaemon/resource.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/geo-replication/syncdaemon/resource.py b/geo-replication/syncdaemon/resource.py +index 4b2a266..d6618c1 100644 +--- a/geo-replication/syncdaemon/resource.py ++++ b/geo-replication/syncdaemon/resource.py +@@ -868,7 +868,7 @@ class Server(object): + # UID:0 and GID:0, and then call chown to set UID/GID + if uid != 0 or gid != 0: + path = os.path.join(pfx, gfid) +- cmd_ret = errno_wrap(os.chown, [path, uid, gid], [ENOENT], ++ cmd_ret = errno_wrap(os.lchown, [path, uid, gid], [ENOENT], + [ESTALE, EINVAL]) + collect_failure(e, cmd_ret) + +-- +1.8.3.1 + diff --git a/0240-shared-storage-Prevent-mounting-shared-storage-from-.patch b/0240-shared-storage-Prevent-mounting-shared-storage-from-.patch new file mode 100644 index 0000000..f30734f --- /dev/null +++ b/0240-shared-storage-Prevent-mounting-shared-storage-from-.patch @@ -0,0 +1,72 @@ +From 73b0dc833716484cba04b46fe0d645975dba44db Mon Sep 17 00:00:00 2001 +From: Mohammed Rafi KC +Date: Mon, 26 Mar 2018 20:27:34 +0530 +Subject: [PATCH 240/260] shared storage: Prevent mounting shared storage from + non-trusted client + +gluster shared storage is a volume used for internal storage for +various features including ganesha, geo-rep, snapshot. + +So this volume should not be exposed to the client, as it is +a special volume for internal use. + +This fix wont't generate non trusted volfile for shared storage volume. + +backport of https://review.gluster.org/#/c/19920/ + +>Change-Id: I8ffe30ae99ec05196d75466210b84db311611a4c +>updates: bz#1570432 +>Signed-off-by: Mohammed Rafi KC + +Change-Id: Ic540b983bcc53a783fda7ca7a283a9ab48d9eeb7 +BUG: 1568969 +Signed-off-by: Mohammed Rafi KC +Reviewed-on: https://code.engineering.redhat.com/gerrit/136708 +Tested-by: RHGS Build Bot +Reviewed-by: Atin Mukherjee +--- + xlators/mgmt/glusterd/src/glusterd-volgen.c | 21 +++++++++++++++++++++ + 1 file changed, 21 insertions(+) + +diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c +index 0e287b6..1c43f24 100644 +--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c ++++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c +@@ -5828,6 +5828,7 @@ generate_client_volfiles (glusterd_volinfo_t *volinfo, + int i = 0; + int ret = -1; + char filepath[PATH_MAX] = {0,}; ++ char *volname = NULL; + char *types[] = {NULL, NULL, NULL}; + dict_t *dict = NULL; + xlator_t *this = NULL; +@@ -5835,6 +5836,26 @@ generate_client_volfiles (glusterd_volinfo_t *volinfo, + + this = THIS; + ++ volname = volinfo->is_snap_volume ? ++ volinfo->parent_volname : volinfo->volname; ++ ++ ++ if (volname && !strcmp (volname, GLUSTER_SHARED_STORAGE) && ++ client_type != GF_CLIENT_TRUSTED) { ++ /* ++ * shared storage volume cannot be mounted from non trusted ++ * nodes. So we are not creating volfiles for non-trusted ++ * clients for shared volumes as well as snapshot of shared ++ * volumes. ++ */ ++ ++ ret = 0; ++ gf_msg_debug ("glusterd", 0, "Skipping the non-trusted volfile" ++ "creation for shared storage volume. Volume %s", ++ volname); ++ goto out; ++ } ++ + enumerate_transport_reqs (volinfo->transport_type, types); + dict = dict_new (); + if (!dict) +-- +1.8.3.1 + diff --git a/0241-server-auth-add-option-for-strict-authentication.patch b/0241-server-auth-add-option-for-strict-authentication.patch new file mode 100644 index 0000000..b6b69ab --- /dev/null +++ b/0241-server-auth-add-option-for-strict-authentication.patch @@ -0,0 +1,283 @@ +From bceb9586b96cbf3e0f1747affa6f56cfe29ac140 Mon Sep 17 00:00:00 2001 +From: Mohammed Rafi KC +Date: Mon, 2 Apr 2018 12:20:47 +0530 +Subject: [PATCH 241/260] server/auth: add option for strict authentication + +When this option is enabled, we will check for a matching +username and password, if not found then the connection will +be rejected. This also does a checksum validation of volfile + +The option is invalid when SSL/TLS is in use, at which point +the SSL/TLS certificate user name is used to validate and +hence authorize the right user. This expects TLS allow rules +to be setup correctly rather than the default *. + +This option is not settable, as a result this cannot be enabled +for volumes using the CLI. This is used with the shared storage +volume, to restrict access to the same in non-SSL/TLS environments +to the gluster peers only. + +Tested: + ./tests/bugs/protocol/bug-1321578.t + ./tests/features/ssl-authz.t + - Ran tests on volumes with and without strict auth + checking (as brick vol file needed to be edited to test, + or rather to enable the option) + - Ran tests on volumes to ensure existing mounts are + disconnected when we enable strict checking + +backport of upstream https://review.gluster.org/#/c/19921/ + +>Change-Id: I2ac4f0cfa5b59cc789cc5a265358389b04556b59 +>fixes: bz#1570432 +>Signed-off-by: Mohammed Rafi KC +>Signed-off-by: ShyamsundarR + +Change-Id: I7fd3194b91ba22d57b851a2a042ff16b9a616a5a +BUG: 1568969 +Signed-off-by: Mohammed Rafi KC +Reviewed-on: https://code.engineering.redhat.com/gerrit/136709 +Tested-by: RHGS Build Bot +Reviewed-by: Atin Mukherjee +--- + xlators/mgmt/glusterd/src/glusterd-volgen.c | 16 +++++++- + xlators/protocol/auth/login/src/login.c | 51 ++++++++++++++++++++++---- + xlators/protocol/server/src/authenticate.h | 4 +- + xlators/protocol/server/src/server-handshake.c | 2 +- + xlators/protocol/server/src/server.c | 18 +++++++++ + xlators/protocol/server/src/server.h | 2 + + 6 files changed, 81 insertions(+), 12 deletions(-) + +diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c +index 1c43f24..3926bd3 100644 +--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c ++++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c +@@ -2341,6 +2341,7 @@ brick_graph_add_server (volgen_graph_t *graph, glusterd_volinfo_t *volinfo, + char *password = NULL; + char key[1024] = {0}; + char *ssl_user = NULL; ++ char *volname = NULL; + char *address_family_data = NULL; + + if (!graph || !volinfo || !set_dict || !brickinfo) +@@ -2416,6 +2417,19 @@ brick_graph_add_server (volgen_graph_t *graph, glusterd_volinfo_t *volinfo, + if (ret) + return -1; + ++ volname = volinfo->is_snap_volume ? ++ volinfo->parent_volname : volinfo->volname; ++ ++ ++ if (volname && !strcmp (volname, GLUSTER_SHARED_STORAGE)) { ++ memset (key, 0, sizeof (key)); ++ snprintf (key, sizeof (key), "strict-auth-accept"); ++ ++ ret = xlator_set_option (xl, key, "true"); ++ if (ret) ++ return -1; ++ } ++ + if (dict_get_str (volinfo->dict, "auth.ssl-allow", &ssl_user) == 0) { + memset (key, 0, sizeof (key)); + snprintf (key, sizeof (key), "auth.login.%s.ssl-allow", +@@ -5841,7 +5855,7 @@ generate_client_volfiles (glusterd_volinfo_t *volinfo, + + + if (volname && !strcmp (volname, GLUSTER_SHARED_STORAGE) && +- client_type != GF_CLIENT_TRUSTED) { ++ client_type != GF_CLIENT_TRUSTED) { + /* + * shared storage volume cannot be mounted from non trusted + * nodes. So we are not creating volfiles for non-trusted +diff --git a/xlators/protocol/auth/login/src/login.c b/xlators/protocol/auth/login/src/login.c +index e799dd2..da10d0b 100644 +--- a/xlators/protocol/auth/login/src/login.c ++++ b/xlators/protocol/auth/login/src/login.c +@@ -11,6 +11,16 @@ + #include + #include "authenticate.h" + ++/* Note on strict_auth ++ * - Strict auth kicks in when authentication is using the username, password ++ * in the volfile to login ++ * - If enabled, auth is rejected if the username and password is not matched ++ * or is not present ++ * - When using SSL names, this is automatically strict, and allows only those ++ * names that are present in the allow list, IOW strict auth checking has no ++ * implication when using SSL names ++*/ ++ + auth_result_t gf_auth (dict_t *input_params, dict_t *config_params) + { + auth_result_t result = AUTH_DONT_CARE; +@@ -27,6 +37,7 @@ auth_result_t gf_auth (dict_t *input_params, dict_t *config_params) + char *tmp = NULL; + char *username_cpy = NULL; + gf_boolean_t using_ssl = _gf_false; ++ gf_boolean_t strict_auth = _gf_false; + + username_data = dict_get (input_params, "ssl-name"); + if (username_data) { +@@ -35,16 +46,39 @@ auth_result_t gf_auth (dict_t *input_params, dict_t *config_params) + using_ssl = _gf_true; + } + else { ++ ret = dict_get_str_boolean (config_params, "strict-auth-accept", ++ _gf_false); ++ if (ret == -1) ++ strict_auth = _gf_false; ++ else ++ strict_auth = ret; ++ + username_data = dict_get (input_params, "username"); + if (!username_data) { +- gf_log ("auth/login", GF_LOG_DEBUG, +- "username not found, returning DONT-CARE"); ++ if (strict_auth) { ++ gf_log ("auth/login", GF_LOG_DEBUG, ++ "username not found, strict auth" ++ " configured returning REJECT"); ++ result = AUTH_REJECT; ++ } else { ++ gf_log ("auth/login", GF_LOG_DEBUG, ++ "username not found, returning" ++ " DONT-CARE"); ++ } + goto out; + } + password_data = dict_get (input_params, "password"); + if (!password_data) { +- gf_log ("auth/login", GF_LOG_WARNING, +- "password not found, returning DONT-CARE"); ++ if (strict_auth) { ++ gf_log ("auth/login", GF_LOG_DEBUG, ++ "password not found, strict auth" ++ " configured returning REJECT"); ++ result = AUTH_REJECT; ++ } else { ++ gf_log ("auth/login", GF_LOG_WARNING, ++ "password not found, returning" ++ " DONT-CARE"); ++ } + goto out; + } + password = data_to_str (password_data); +@@ -62,9 +96,10 @@ auth_result_t gf_auth (dict_t *input_params, dict_t *config_params) + ret = gf_asprintf (&searchstr, "auth.login.%s.%s", brick_name, + using_ssl ? "ssl-allow" : "allow"); + if (-1 == ret) { +- gf_log ("auth/login", GF_LOG_WARNING, ++ gf_log ("auth/login", GF_LOG_ERROR, + "asprintf failed while setting search string, " +- "returning DONT-CARE"); ++ "returning REJECT"); ++ result = AUTH_REJECT; + goto out; + } + +@@ -92,8 +127,10 @@ auth_result_t gf_auth (dict_t *input_params, dict_t *config_params) + * ssl-allow=* case as well) authorization is effectively + * disabled, though authentication and encryption are still + * active. ++ * ++ * Read NOTE on strict_auth above. + */ +- if (using_ssl) { ++ if (using_ssl || strict_auth) { + result = AUTH_REJECT; + } + username_cpy = gf_strdup (allow_user->data); +diff --git a/xlators/protocol/server/src/authenticate.h b/xlators/protocol/server/src/authenticate.h +index 3f80231..5f92183 100644 +--- a/xlators/protocol/server/src/authenticate.h ++++ b/xlators/protocol/server/src/authenticate.h +@@ -37,10 +37,8 @@ typedef struct { + volume_opt_list_t *vol_opt; + } auth_handle_t; + +-auth_result_t gf_authenticate (dict_t *input_params, +- dict_t *config_params, +- dict_t *auth_modules); + int32_t gf_auth_init (xlator_t *xl, dict_t *auth_modules); + void gf_auth_fini (dict_t *auth_modules); ++auth_result_t gf_authenticate (dict_t *, dict_t *, dict_t *); + + #endif /* _AUTHENTICATE_H */ +diff --git a/xlators/protocol/server/src/server-handshake.c b/xlators/protocol/server/src/server-handshake.c +index cbc93a3..fc63f2c 100644 +--- a/xlators/protocol/server/src/server-handshake.c ++++ b/xlators/protocol/server/src/server-handshake.c +@@ -747,7 +747,7 @@ server_setvolume (rpcsvc_request_t *req) + ret = dict_get_str (params, "volfile-key", + &volfile_key); + if (ret) +- gf_msg_debug (this->name, 0, "failed to set " ++ gf_msg_debug (this->name, 0, "failed to get " + "'volfile-key'"); + + ret = _validate_volfile_checksum (this, volfile_key, +diff --git a/xlators/protocol/server/src/server.c b/xlators/protocol/server/src/server.c +index eed4295..6f20a06 100644 +--- a/xlators/protocol/server/src/server.c ++++ b/xlators/protocol/server/src/server.c +@@ -943,6 +943,10 @@ do_rpc: + goto out; + } + ++ GF_OPTION_RECONF ("strict-auth-accept", conf->strict_auth_enabled, ++ options, bool, out); ++ ++ + GF_OPTION_RECONF ("dynamic-auth", conf->dync_auth, options, + bool, out); + +@@ -1183,6 +1187,14 @@ init (xlator_t *this) + "Failed to initialize group cache."); + goto out; + } ++ ++ ret = dict_get_str_boolean (this->options, "strict-auth-accept", ++ _gf_false); ++ if (ret == -1) ++ conf->strict_auth_enabled = _gf_false; ++ else ++ conf->strict_auth_enabled = ret; ++ + ret = dict_get_str_boolean (this->options, "dynamic-auth", + _gf_true); + if (ret == -1) +@@ -1840,5 +1852,11 @@ struct volume_options options[] = { + "transport connection immediately in response to " + "*.allow | *.reject volume set options." + }, ++ { .key = {"strict-auth-accept"}, ++ .type = GF_OPTION_TYPE_BOOL, ++ .default_value = "off", ++ .description = "strict-auth-accept reject connection with out" ++ "a valid username and password." ++ }, + { .key = {NULL} }, + }; +diff --git a/xlators/protocol/server/src/server.h b/xlators/protocol/server/src/server.h +index af987aa..691c75b 100644 +--- a/xlators/protocol/server/src/server.h ++++ b/xlators/protocol/server/src/server.h +@@ -24,6 +24,7 @@ + #include "client_t.h" + #include "gidcache.h" + #include "defaults.h" ++#include "authenticate.h" + + #define DEFAULT_BLOCK_SIZE 4194304 /* 4MB */ + #define DEFAULT_VOLUME_FILE_PATH CONFDIR "/glusterfs.vol" +@@ -109,6 +110,7 @@ struct server_conf { + * tweeked */ + struct _child_status *child_status; + gf_lock_t itable_lock; ++ gf_boolean_t strict_auth_enabled; + }; + typedef struct server_conf server_conf_t; + +-- +1.8.3.1 + diff --git a/0242-feature-changelog-remove-unused-variable.patch b/0242-feature-changelog-remove-unused-variable.patch new file mode 100644 index 0000000..d97321d --- /dev/null +++ b/0242-feature-changelog-remove-unused-variable.patch @@ -0,0 +1,31 @@ +From 05942267fc5d33be457cf07f95d9dae2341e1050 Mon Sep 17 00:00:00 2001 +From: Sunil Kumar Acharya +Date: Wed, 25 Apr 2018 14:56:55 +0530 +Subject: [PATCH 242/260] feature/changelog: remove unused variable + +Fix removes unsed variable in notify(). + +BUG: 1571645 +Change-Id: I60fb61ae4ed3e80e2ecf93935477db0fcb2cd156 +Signed-off-by: Sunil Kumar Acharya +Reviewed-on: https://code.engineering.redhat.com/gerrit/136830 +Tested-by: RHGS Build Bot +--- + xlators/features/changelog/src/changelog.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/xlators/features/changelog/src/changelog.c b/xlators/features/changelog/src/changelog.c +index 121ab04..7e36172 100644 +--- a/xlators/features/changelog/src/changelog.c ++++ b/xlators/features/changelog/src/changelog.c +@@ -2102,7 +2102,6 @@ notify (xlator_t *this, int event, void *data, ...) + int ret = 0; + int ret1 = 0; + struct list_head queue = {0, }; +- int i = 0; + + INIT_LIST_HEAD (&queue); + +-- +1.8.3.1 + diff --git a/0243-timer-Fix-possible-race-during-cleanup.patch b/0243-timer-Fix-possible-race-during-cleanup.patch new file mode 100644 index 0000000..f5f5fbb --- /dev/null +++ b/0243-timer-Fix-possible-race-during-cleanup.patch @@ -0,0 +1,86 @@ +From 4623ebe9a69a5284565b4ad253084a1236478988 Mon Sep 17 00:00:00 2001 +From: Soumya Koduri +Date: Fri, 3 Nov 2017 15:41:34 +0530 +Subject: [PATCH 243/260] timer: Fix possible race during cleanup + +As mentioned in bug1509189, there is a possible race +between gf_timer_cancel(), gf_timer_proc() and +gf_timer_registry_destroy() leading to use_after_free. + +Problem: + +1) gf_timer_proc() is called, locks reg, and gets an event. +It unlocks reg, and calls the callback. + +2) Meanwhile gf_timer_registry_destroy() is called, and removes +reg from ctx, and joins on gf_timer_proc(). + +3) gf_timer_call_cancel() is called on the event being +processed. It cannot find reg (since it's been removed from reg), +so it frees event. + +4) the callback returns into gf_timer_proc(), and it tries to free +event, but it's already free, so double free. + +Solution: +The fix is to bail out in gf_timer_cancel() when registry +is not found. The logic behind this is that, gf_timer_cancel() +is called only on any existing event. That means there was a valid +registry earlier while creating that event. And the only reason +we cannot find that registry now is that it must have got set to +NULL when context cleanup is started. +Since gf_timer_proc() takes care of releasing all the remaining +events active on that registry, it seems safe to bail out +in gf_timer_cancel(). + +>Change-Id: Ia9b088533141c3bb335eff2fe06b52d1575bb34f +>BUG: 1509189 +>Reported-by: Daniel Gryniewicz +>Signed-off-by: Soumya Koduri +Upstream Link: https://review.gluster.org/#/c/18652/ + +BUG: 1568374 +Change-Id: Ia9b088533141c3bb335eff2fe06b52d1575bb34f +Signed-off-by: Sunil Kumar Acharya +Reviewed-on: https://code.engineering.redhat.com/gerrit/135896 +Tested-by: RHGS Build Bot +--- + libglusterfs/src/timer.c | 15 ++++++++++++--- + 1 file changed, 12 insertions(+), 3 deletions(-) + +diff --git a/libglusterfs/src/timer.c b/libglusterfs/src/timer.c +index 34dfd35..d6f008d 100644 +--- a/libglusterfs/src/timer.c ++++ b/libglusterfs/src/timer.c +@@ -83,6 +83,13 @@ gf_timer_call_cancel (glusterfs_ctx_t *ctx, + return 0; + } + ++ if (ctx->cleanup_started) { ++ gf_msg_callingfn ("timer", GF_LOG_INFO, 0, ++ LG_MSG_CTX_CLEANUP_STARTED, ++ "ctx cleanup started"); ++ return 0; ++ } ++ + LOCK (&ctx->lock); + { + reg = ctx->timer; +@@ -90,9 +97,11 @@ gf_timer_call_cancel (glusterfs_ctx_t *ctx, + UNLOCK (&ctx->lock); + + if (!reg) { +- gf_msg ("timer", GF_LOG_ERROR, 0, LG_MSG_INIT_TIMER_FAILED, +- "!reg"); +- GF_FREE (event); ++ /* This can happen when cleanup may have just started and ++ * gf_timer_registry_destroy() sets ctx->timer to NULL. ++ * Just bail out as success as gf_timer_proc() takes ++ * care of cleaning up the events. ++ */ + return 0; + } + +-- +1.8.3.1 + diff --git a/0244-common-ha-All-statd-related-files-need-to-be-owned-b.patch b/0244-common-ha-All-statd-related-files-need-to-be-owned-b.patch new file mode 100644 index 0000000..8b2fd17 --- /dev/null +++ b/0244-common-ha-All-statd-related-files-need-to-be-owned-b.patch @@ -0,0 +1,93 @@ +From 9a458a8a0bdd88ff44f80b6b5a4c5fbaa970500f Mon Sep 17 00:00:00 2001 +From: Soumya Koduri +Date: Thu, 19 Jan 2017 15:01:12 +0530 +Subject: [PATCH 244/260] common-ha: All statd related files need to be owned + by rpcuser + +Statd service is started as rpcuser by default. Hence the +files/directories needed by it under '/var/lib/nfs' should be +owned by the same user. + +Note: This change is not in mainline as the cluster-bits +are being moved to storehaug project - +http://review.gluster.org/#/c/16349/ +http://review.gluster.org/#/c/16333/ + +Label: BACKPORT FROM UPSTREAM 3.10 + +Upstream Reference : +> Change-Id: I89fd06aa9700c5ce60026ac825da7c154d9f48fd +> BUG: 1414665 +> Signed-off-by: Soumya Koduri +> Reviewed-on: http://review.gluster.org/16433 +> Reviewed-by: jiffin tony Thottan +> Smoke: Gluster Build System +> Tested-by: Kaleb KEITHLEY +> NetBSD-regression: NetBSD Build System +> CentOS-regression: Gluster Build System + +Change-Id: I89fd06aa9700c5ce60026ac825da7c154d9f48fd +BUG: 1565015 +Signed-off-by: Jiffin Tony Thottan +Reviewed-on: https://code.engineering.redhat.com/gerrit/137254 +Tested-by: RHGS Build Bot +Reviewed-by: Atin Mukherjee +--- + extras/ganesha/scripts/ganesha-ha.sh | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/extras/ganesha/scripts/ganesha-ha.sh b/extras/ganesha/scripts/ganesha-ha.sh +index 4459068..5cdafad 100644 +--- a/extras/ganesha/scripts/ganesha-ha.sh ++++ b/extras/ganesha/scripts/ganesha-ha.sh +@@ -756,9 +756,11 @@ setup_state_volume() + fi + if [ ! -d ${mnt}/nfs-ganesha/${dirname}/nfs/statd ]; then + mkdir ${mnt}/nfs-ganesha/${dirname}/nfs/statd ++ chown rpcuser:rpcuser ${mnt}/nfs-ganesha/${dirname}/nfs/statd + fi + if [ ! -e ${mnt}/nfs-ganesha/${dirname}/nfs/state ]; then + touch ${mnt}/nfs-ganesha/${dirname}/nfs/state ++ chown rpcuser:rpcuser ${mnt}/nfs-ganesha/${dirname}/nfs/state + fi + if [ ! -d ${mnt}/nfs-ganesha/${dirname}/nfs/ganesha/v4recov ]; then + mkdir ${mnt}/nfs-ganesha/${dirname}/nfs/ganesha/v4recov +@@ -768,9 +770,11 @@ setup_state_volume() + fi + if [ ! -d ${mnt}/nfs-ganesha/${dirname}/nfs/statd/sm ]; then + mkdir ${mnt}/nfs-ganesha/${dirname}/nfs/statd/sm ++ chown rpcuser:rpcuser ${mnt}/nfs-ganesha/${dirname}/nfs/statd/sm + fi + if [ ! -d ${mnt}/nfs-ganesha/${dirname}/nfs/statd/sm.bak ]; then + mkdir ${mnt}/nfs-ganesha/${dirname}/nfs/statd/sm.bak ++ chown rpcuser:rpcuser ${mnt}/nfs-ganesha/${dirname}/nfs/statd/sm.bak + fi + if [ ! -e ${mnt}/nfs-ganesha/${dirname}/nfs/statd/state ]; then + touch ${mnt}/nfs-ganesha/${dirname}/nfs/statd/state +@@ -830,9 +834,11 @@ addnode_state_volume() + fi + if [ ! -d ${mnt}/nfs-ganesha/${dirname}/nfs/statd ]; then + mkdir ${mnt}/nfs-ganesha/${dirname}/nfs/statd ++ chown rpcuser:rpcuser ${mnt}/nfs-ganesha/${dirname}/nfs/statd + fi + if [ ! -e ${mnt}/nfs-ganesha/${dirname}/nfs/state ]; then + touch ${mnt}/nfs-ganesha/${dirname}/nfs/state ++ chown rpcuser:rpcuser ${mnt}/nfs-ganesha/${dirname}/nfs/state + fi + if [ ! -d ${mnt}/nfs-ganesha/${dirname}/nfs/ganesha/v4recov ]; then + mkdir ${mnt}/nfs-ganesha/${dirname}/nfs/ganesha/v4recov +@@ -842,9 +848,11 @@ addnode_state_volume() + fi + if [ ! -d ${mnt}/nfs-ganesha/${dirname}/nfs/statd/sm ]; then + mkdir ${mnt}/nfs-ganesha/${dirname}/nfs/statd/sm ++ chown rpcuser:rpcuser ${mnt}/nfs-ganesha/${dirname}/nfs/statd/sm + fi + if [ ! -d ${mnt}/nfs-ganesha/${dirname}/nfs/statd/sm.bak ]; then + mkdir ${mnt}/nfs-ganesha/${dirname}/nfs/statd/sm.bak ++ chown rpcuser:rpcuser ${mnt}/nfs-ganesha/${dirname}/nfs/statd/sm.bak + fi + if [ ! -e ${mnt}/nfs-ganesha/${dirname}/nfs/statd/state ]; then + touch ${mnt}/nfs-ganesha/${dirname}/nfs/statd/state +-- +1.8.3.1 + diff --git a/0245-build-make-RHGS-version-available-for-server.patch b/0245-build-make-RHGS-version-available-for-server.patch new file mode 100644 index 0000000..f88361a --- /dev/null +++ b/0245-build-make-RHGS-version-available-for-server.patch @@ -0,0 +1,56 @@ +From 01b371af8dc6f95c00facd5215ab4c939a86f1db Mon Sep 17 00:00:00 2001 +From: Milind Changire +Date: Mon, 23 Apr 2018 13:16:30 +0530 +Subject: [PATCH 245/260] build: make RHGS version available for server + +Make /usr/share/glusterfs/release available for gluserfs-server package. +This file contains the RHGS release number for the release. + +Label: DOWNSTREAM ONLY + +Change-Id: I7485f77cfb8ca7f0f8363a20124900ae9ae8a528 +BUG: 1570514 +Signed-off-by: Milind Changire +Reviewed-on: https://code.engineering.redhat.com/gerrit/137139 +Tested-by: RHGS Build Bot +Reviewed-by: Atin Mukherjee +--- + glusterfs.spec.in | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/glusterfs.spec.in b/glusterfs.spec.in +index 64e7e29..36b465a 100644 +--- a/glusterfs.spec.in ++++ b/glusterfs.spec.in +@@ -865,6 +865,10 @@ find ./tests ./run-tests.sh -type f | cpio -pd %{buildroot}%{_prefix}/share/glus + install -p -m 0744 -D extras/command-completion/gluster.bash \ + %{buildroot}%{_sysconfdir}/bash_completion.d/gluster + ++%if ( 0%{?_build_server} ) ++echo "RHGS 3.4.0" > %{buildroot}%{_datadir}/glusterfs/release ++%endif ++ + %clean + rm -rf %{buildroot} + +@@ -1566,6 +1570,7 @@ exit 0 + + # Extra utility script + %dir %{_libexecdir}/glusterfs ++ %{_datadir}/glusterfs/release + %dir %{_datadir}/glusterfs/scripts + %{_datadir}/glusterfs/scripts/stop-all-gluster-processes.sh + %if ( 0%{?_with_systemd:1} ) +@@ -2155,6 +2160,9 @@ fi + %endif + + %changelog ++* Mon Apr 23 2018 Milind Changire ++- make RHGS release number available in /usr/share/glusterfs/release (#1570514) ++ + * Wed Apr 18 2018 Atin Mukherjee + - Revert SELinux hooks (#1565962) + +-- +1.8.3.1 + diff --git a/0246-glusterd-Fix-for-memory-leak-in-get-state-detail.patch b/0246-glusterd-Fix-for-memory-leak-in-get-state-detail.patch new file mode 100644 index 0000000..66e9f21 --- /dev/null +++ b/0246-glusterd-Fix-for-memory-leak-in-get-state-detail.patch @@ -0,0 +1,45 @@ +From 4ff96e11ea80d9a0d9dec2031c9cdd99d2afdc61 Mon Sep 17 00:00:00 2001 +From: Sanju Rakonde +Date: Mon, 30 Apr 2018 11:12:34 +0530 +Subject: [PATCH 246/260] glusterd: Fix for memory leak in get-state detail + +>Fixes: bz#1573066 +>Change-Id: I76fe3bdde7351736b32eb3d6c4cc5f8f276257ed +>Signed-off-by: Sanju Rakonde + +upstream patch: https://review.gluster.org/#/c/19948/ + +BUG: 1567899 +Change-Id: I76fe3bdde7351736b32eb3d6c4cc5f8f276257ed +Signed-off-by: Sanju Rakonde +Reviewed-on: https://code.engineering.redhat.com/gerrit/137469 +Tested-by: RHGS Build Bot +Reviewed-by: Sunil Kumar Heggodu Gopala Acharya +--- + xlators/mgmt/glusterd/src/glusterd-handler.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c +index 30adb99..962c87e 100644 +--- a/xlators/mgmt/glusterd/src/glusterd-handler.c ++++ b/xlators/mgmt/glusterd/src/glusterd-handler.c +@@ -5409,8 +5409,15 @@ out: + if (pending_node) + GF_FREE (pending_node); + +- if (brick_req) ++ if (brick_req) { ++ if (brick_req->input.input_val) ++ GF_FREE (brick_req->input.input_val); + GF_FREE (brick_req); ++ } ++ if (args.dict) ++ dict_unref (args.dict); ++ if (args.errstr) ++ GF_FREE (args.errstr); + + return ret; + } +-- +1.8.3.1 + diff --git a/0247-protocol-server-unwind-as-per-op-version.patch b/0247-protocol-server-unwind-as-per-op-version.patch new file mode 100644 index 0000000..b5f2a82 --- /dev/null +++ b/0247-protocol-server-unwind-as-per-op-version.patch @@ -0,0 +1,74 @@ +From 3c8ff0fceb008dca51cebfc9e808f6268548661a Mon Sep 17 00:00:00 2001 +From: Ashish Pandey +Date: Wed, 25 Apr 2018 16:48:56 +0530 +Subject: [PATCH 247/260] protocol/server : unwind as per op version + +>Change-Id: Id6717640ac14881b490e512c4682e45ffffa7f5b +upstream patch - +https://review.gluster.org/#/c/19938/ + +Change-Id: I43034c2974108c434bd3e4c553ff416339ece870 +BUG: 1558948 +Signed-off-by: Ashish Pandey +Reviewed-on: https://code.engineering.redhat.com/gerrit/137625 +Tested-by: RHGS Build Bot +Reviewed-by: Sunil Kumar Heggodu Gopala Acharya +--- + libglusterfs/src/client_t.h | 1 + + xlators/features/locks/src/posix.c | 8 +++++++- + xlators/protocol/server/src/server-handshake.c | 5 +++-- + 3 files changed, 11 insertions(+), 3 deletions(-) + +diff --git a/libglusterfs/src/client_t.h b/libglusterfs/src/client_t.h +index 530c0a3..088508e 100644 +--- a/libglusterfs/src/client_t.h ++++ b/libglusterfs/src/client_t.h +@@ -45,6 +45,7 @@ typedef struct _client { + char *subdir_mount; + inode_t *subdir_inode; + uuid_t subdir_gfid; ++ int32_t opversion; + } client_t; + + #define GF_CLIENTCTX_INITIAL_SIZE 8 +diff --git a/xlators/features/locks/src/posix.c b/xlators/features/locks/src/posix.c +index a158227..ef4bebf 100644 +--- a/xlators/features/locks/src/posix.c ++++ b/xlators/features/locks/src/posix.c +@@ -1563,7 +1563,13 @@ int + pl_flush_cbk (call_frame_t *frame, void *cookie, xlator_t *this, + int32_t op_ret, int32_t op_errno, dict_t *xdata) + { +- PL_STACK_UNWIND (flush, xdata, frame, op_ret, op_errno, xdata); ++ ++ if (frame->root->client && ++ (frame->root->client->opversion < GD_OP_VERSION_3_12_0)) { ++ STACK_UNWIND_STRICT (flush, frame, op_ret, op_errno, xdata); ++ } else { ++ PL_STACK_UNWIND (flush, xdata, frame, op_ret, op_errno, xdata); ++ } + + return 0; + } +diff --git a/xlators/protocol/server/src/server-handshake.c b/xlators/protocol/server/src/server-handshake.c +index fc63f2c..a59bcda 100644 +--- a/xlators/protocol/server/src/server-handshake.c ++++ b/xlators/protocol/server/src/server-handshake.c +@@ -778,11 +778,12 @@ server_setvolume (rpcsvc_request_t *req) + } + + ret = dict_get_uint32 (params, "opversion", &opversion); +- if (ret) ++ if (ret) { + gf_msg (this->name, GF_LOG_INFO, 0, + PS_MSG_CLIENT_OPVERSION_GET_FAILED, + "Failed to get client opversion"); +- ++ } ++ client->opversion = opversion; + /* Assign op-version value to the client */ + pthread_mutex_lock (&conf->mutex); + list_for_each_entry (xprt, &conf->xprt_list, list) { +-- +1.8.3.1 + diff --git a/0248-performance-md-cache-purge-cache-on-ENOENT-ESTALE-er.patch b/0248-performance-md-cache-purge-cache-on-ENOENT-ESTALE-er.patch new file mode 100644 index 0000000..b233dbb --- /dev/null +++ b/0248-performance-md-cache-purge-cache-on-ENOENT-ESTALE-er.patch @@ -0,0 +1,1042 @@ +From 30993baa95ef0eac8abd461f12839247b76d6e4c Mon Sep 17 00:00:00 2001 +From: Raghavendra G +Date: Mon, 23 Apr 2018 19:21:20 +0530 +Subject: [PATCH 248/260] performance/md-cache: purge cache on ENOENT/ESTALE + errors + +If not, next lookup could be served from cache and can be success, +which is wrong. This can affect retry logic of VFS when it receives an +ESTALE. + +> Change-Id: Iad8e564d666aa4172823343f19a60c11e4416ef6 +> Signed-off-by: Raghavendra G +> Fixes: bz#1571593 + +(cherry picked from commit 6912441543192a366f264b61d97d50faf3815a28) +Change-Id: Iad8e564d666aa4172823343f19a60c11e4416ef6 +BUG: 1546717 +Signed-off-by: Raghavendra G +Fixes: bz#1546717 +upstream: https://review.gluster.org/19926 +Reviewed-on: https://code.engineering.redhat.com/gerrit/136806 +Tested-by: RHGS Build Bot +Reviewed-by: Poornima Gurusiddaiah +Reviewed-by: Sunil Kumar Heggodu Gopala Acharya +--- + xlators/performance/md-cache/src/md-cache.c | 624 ++++++++++++++++++++++++---- + 1 file changed, 545 insertions(+), 79 deletions(-) + +diff --git a/xlators/performance/md-cache/src/md-cache.c b/xlators/performance/md-cache/src/md-cache.c +index feab357..9d2eea6 100644 +--- a/xlators/performance/md-cache/src/md-cache.c ++++ b/xlators/performance/md-cache/src/md-cache.c +@@ -24,11 +24,18 @@ + #include "md-cache-messages.h" + #include "statedump.h" + #include "atomic.h" ++#include "timespec.h" + + /* TODO: + - cache symlink() link names and nuke symlink-cache + - send proper postbuf in setattr_cbk even when op_ret = -1 + */ ++struct mdc_statfs_cache { ++ pthread_mutex_t lock; ++ gf_boolean_t initialized; ++ struct timespec last_refreshed; ++ struct statvfs buf; ++}; + + struct mdc_statistics { + gf_atomic_t stat_hit; /* No. of times lookup/stat was served from +@@ -65,6 +72,8 @@ struct mdc_conf { + time_t last_child_down; + gf_lock_t lock; + struct mdc_statistics mdc_counter; ++ gf_boolean_t cache_statfs; ++ struct mdc_statfs_cache statfs_cache; + }; + + +@@ -1062,20 +1071,165 @@ mdc_xattr_satisfied (xlator_t *this, dict_t *req, dict_t *rsp) + return pair.ret; + } + ++static void ++mdc_cache_statfs (xlator_t *this, struct statvfs *buf) ++{ ++ struct mdc_conf *conf = this->private; ++ ++ pthread_mutex_lock (&conf->statfs_cache.lock); ++ { ++ memcpy (&conf->statfs_cache.buf, buf, sizeof (struct statvfs)); ++ clock_gettime (CLOCK_MONOTONIC, ++ &conf->statfs_cache.last_refreshed); ++ conf->statfs_cache.initialized = _gf_true; ++ } ++ pthread_mutex_unlock (&conf->statfs_cache.lock); ++} + + int +-mdc_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this, +- int32_t op_ret, int32_t op_errno, inode_t *inode, +- struct iatt *stbuf, dict_t *dict, struct iatt *postparent) ++mdc_load_statfs_info_from_cache (xlator_t *this, struct statvfs **buf) + { +- mdc_local_t *local = NULL; + struct mdc_conf *conf = this->private; ++ struct timespec now; ++ double cache_age = 0.0; ++ int ret = 0; ++ ++ if (!buf || !conf) { ++ ret = -1; ++ goto err; ++ } ++ ++ pthread_mutex_lock (&conf->statfs_cache.lock); ++ { ++ *buf = NULL; ++ ++ /* Skip if the cache is not initialized */ ++ if (!conf->statfs_cache.initialized) { ++ ret = -1; ++ goto err; ++ } ++ ++ timespec_now (&now); ++ ++ cache_age = ( ++ now.tv_sec - conf->statfs_cache.last_refreshed.tv_sec); ++ ++ gf_log (this->name, GF_LOG_DEBUG, ++ "STATFS cache age = %lf", cache_age); ++ if (cache_age > conf->timeout) { ++ /* Expire the cache */ ++ gf_log (this->name, GF_LOG_DEBUG, ++ "Cache age %lf exceeded timeout %d", ++ cache_age, conf->timeout); ++ ret = -1; ++ goto err; ++ } ++ ++ *buf = &conf->statfs_cache.buf; ++ } ++err: ++ pthread_mutex_unlock (&conf->statfs_cache.lock); ++ return ret; ++} ++ ++int ++mdc_statfs_cbk (call_frame_t *frame, void *cookie, xlator_t *this, ++ int32_t op_ret, int32_t op_errno, ++ struct statvfs *buf, dict_t *xdata) ++{ ++ struct mdc_conf *conf = this->private; ++ mdc_local_t *local = NULL; ++ ++ local = frame->local; ++ if (!local) ++ goto out; ++ ++ if (op_ret != 0) { ++ if ((op_errno == ENOENT) || (op_errno == ESTALE)) { ++ mdc_inode_iatt_invalidate (this, local->loc.inode); ++ } ++ ++ goto out; ++ } ++ ++ if (conf && conf->cache_statfs) { ++ mdc_cache_statfs (this, buf); ++ } ++ ++out: ++ MDC_STACK_UNWIND (statfs, frame, op_ret, op_errno, buf, xdata); ++ ++ return 0; ++} ++ ++int ++mdc_statfs (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) ++{ ++ int ret = 0, op_ret = 0, op_errno = 0; ++ struct statvfs *buf = NULL; ++ mdc_local_t *local = NULL; ++ struct mdc_conf *conf = this->private; ++ ++ local = mdc_local_get (frame); ++ if (!local) { ++ op_ret = -1; ++ op_errno = ENOMEM; ++ goto out; ++ } ++ ++ loc_copy (&local->loc, loc); ++ ++ if (!conf) { ++ goto uncached; ++ } ++ ++ if (!conf->cache_statfs) { ++ goto uncached; ++ } ++ ++ ret = mdc_load_statfs_info_from_cache (this, &buf); ++ if (ret == 0 && buf) { ++ op_ret = 0; ++ op_errno = 0; ++ goto out; ++ } ++ ++uncached: ++ STACK_WIND (frame, mdc_statfs_cbk, FIRST_CHILD (this), ++ FIRST_CHILD (this)->fops->statfs, loc, xdata); ++ return 0; ++ ++out: ++ STACK_UNWIND_STRICT (statfs, frame, op_ret, op_errno, buf, xdata); ++ return 0; ++} ++ ++int ++mdc_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this, ++ int32_t op_ret, int32_t op_errno, inode_t *inode, ++ struct iatt *stbuf, dict_t *dict, struct iatt *postparent) ++{ ++ mdc_local_t *local = NULL; ++ struct mdc_conf *conf = this->private; + + local = frame->local; + + if (op_ret != 0) { + if (op_errno == ENOENT) + GF_ATOMIC_INC (conf->mdc_counter.negative_lookup); ++ ++ if (op_errno == ESTALE) { ++ /* if op_errno is ENOENT, fuse-bridge will unlink the ++ * dentry ++ */ ++ if (local->loc.parent) ++ mdc_inode_iatt_invalidate (this, ++ local->loc.parent); ++ else ++ mdc_inode_iatt_invalidate (this, ++ local->loc.inode); ++ } ++ + goto out; + } + +@@ -1185,13 +1339,18 @@ mdc_stat_cbk (call_frame_t *frame, void *cookie, xlator_t *this, + { + mdc_local_t *local = NULL; + +- if (op_ret != 0) +- goto out; +- + local = frame->local; + if (!local) + goto out; + ++ if (op_ret != 0) { ++ if ((op_errno == ESTALE) || (op_errno == ENOENT)) { ++ mdc_inode_iatt_invalidate (this, local->loc.inode); ++ } ++ ++ goto out; ++ } ++ + mdc_inode_iatt_set (this, local->loc.inode, buf); + + out: +@@ -1240,13 +1399,18 @@ mdc_fstat_cbk (call_frame_t *frame, void *cookie, xlator_t *this, + { + mdc_local_t *local = NULL; + +- if (op_ret != 0) +- goto out; +- + local = frame->local; + if (!local) + goto out; + ++ if (op_ret != 0) { ++ if ((op_errno == ENOENT) || (op_errno == ESTALE)) { ++ mdc_inode_iatt_invalidate (this, local->fd->inode); ++ } ++ ++ goto out; ++ } ++ + mdc_inode_iatt_set (this, local->fd->inode, buf); + + out: +@@ -1297,11 +1461,15 @@ mdc_truncate_cbk (call_frame_t *frame, void *cookie, xlator_t *this, + + local = frame->local; + +- if (op_ret != 0) ++ if (!local) + goto out; + +- if (!local) ++ if (op_ret != 0) { ++ if ((op_errno == ESTALE) || (op_errno == ENOENT)) ++ mdc_inode_iatt_invalidate (this, local->loc.inode); ++ + goto out; ++ } + + mdc_inode_iatt_set_validate(this, local->loc.inode, prebuf, postbuf, + _gf_true); +@@ -1340,11 +1508,15 @@ mdc_ftruncate_cbk (call_frame_t *frame, void *cookie, xlator_t *this, + + local = frame->local; + +- if (op_ret != 0) ++ if (!local) + goto out; + +- if (!local) ++ if (op_ret != 0) { ++ if ((op_errno == ENOENT) || (op_errno == ESTALE)) ++ mdc_inode_iatt_invalidate (this, local->fd->inode); ++ + goto out; ++ } + + mdc_inode_iatt_set_validate(this, local->fd->inode, prebuf, postbuf, + _gf_true); +@@ -1384,11 +1556,16 @@ mdc_mknod_cbk (call_frame_t *frame, void *cookie, xlator_t *this, + + local = frame->local; + +- if (op_ret != 0) ++ if (!local) + goto out; + +- if (!local) ++ if (op_ret != 0) { ++ if ((op_errno == ESTALE) || (op_errno == ENOENT)) { ++ mdc_inode_iatt_invalidate (this, local->loc.parent); ++ } ++ + goto out; ++ } + + if (local->loc.parent) { + mdc_inode_iatt_set (this, local->loc.parent, postparent); +@@ -1433,11 +1610,16 @@ mdc_mkdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this, + + local = frame->local; + +- if (op_ret != 0) ++ if (!local) + goto out; + +- if (!local) ++ if (op_ret != 0) { ++ if ((op_errno == ESTALE) || (op_errno == ENOENT)) { ++ mdc_inode_iatt_invalidate (this, local->loc.parent); ++ } ++ + goto out; ++ } + + if (local->loc.parent) { + mdc_inode_iatt_set (this, local->loc.parent, postparent); +@@ -1481,11 +1663,24 @@ mdc_unlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this, + + local = frame->local; + +- if (op_ret != 0) ++ if (!local) + goto out; + +- if (!local) ++ if (op_ret != 0) { ++ /* if errno is ESTALE, parent is not present, which implies even ++ * child is not present. Also, man 2 unlink states unlink can ++ * return ENOENT if a component in pathname does not ++ * exist or is a dangling symbolic link. So, invalidate both ++ * parent and child for both errno ++ */ ++ ++ if ((op_errno == ENOENT) || (op_errno == ESTALE)) { ++ mdc_inode_iatt_invalidate (this, local->loc.inode); ++ mdc_inode_iatt_invalidate (this, local->loc.parent); ++ } ++ + goto out; ++ } + + if (local->loc.parent) { + mdc_inode_iatt_set (this, local->loc.parent, postparent); +@@ -1528,11 +1723,24 @@ mdc_rmdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this, + + local = frame->local; + +- if (op_ret != 0) ++ if (!local) + goto out; + +- if (!local) ++ if (op_ret != 0) { ++ /* if errno is ESTALE, parent is not present, which implies even ++ * child is not present. Also, man 2 rmdir states rmdir can ++ * return ENOENT if a directory component in pathname does not ++ * exist or is a dangling symbolic link. So, invalidate both ++ * parent and child for both errno ++ */ ++ ++ if ((op_errno == ESTALE) || (op_errno == ENOENT)) { ++ mdc_inode_iatt_invalidate (this, local->loc.inode); ++ mdc_inode_iatt_invalidate (this, local->loc.parent); ++ } ++ + goto out; ++ } + + if (local->loc.parent) { + mdc_inode_iatt_set (this, local->loc.parent, postparent); +@@ -1572,11 +1780,16 @@ mdc_symlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this, + + local = frame->local; + +- if (op_ret != 0) ++ if (!local) + goto out; + +- if (!local) ++ if (op_ret != 0) { ++ if ((op_errno == ESTALE) || (op_errno == ENOENT)) { ++ mdc_inode_iatt_invalidate (this, local->loc.parent); ++ } ++ + goto out; ++ } + + if (local->loc.parent) { + mdc_inode_iatt_set (this, local->loc.parent, postparent); +@@ -1621,12 +1834,17 @@ mdc_rename_cbk (call_frame_t *frame, void *cookie, xlator_t *this, + mdc_local_t *local = NULL; + + local = frame->local; +- +- if (op_ret != 0) ++ if (!local) + goto out; + +- if (!local) ++ if (op_ret != 0) { ++ if ((op_errno == ESTALE) || (op_errno == ENOENT)) { ++ mdc_inode_iatt_invalidate (this, local->loc.inode); ++ mdc_inode_iatt_invalidate (this, local->loc2.parent); ++ } ++ + goto out; ++ } + + if (local->loc.parent) { + mdc_inode_iatt_set (this, local->loc.parent, postoldparent); +@@ -1678,11 +1896,17 @@ mdc_link_cbk (call_frame_t *frame, void *cookie, xlator_t *this, + + local = frame->local; + +- if (op_ret != 0) ++ if (!local) + goto out; + +- if (!local) ++ if (op_ret != 0) { ++ if ((op_errno == ENOENT) || (op_errno == ESTALE)) { ++ mdc_inode_iatt_invalidate (this, local->loc.inode); ++ mdc_inode_iatt_invalidate (this, local->loc2.parent); ++ } ++ + goto out; ++ } + + if (local->loc.inode) { + mdc_inode_iatt_set (this, local->loc.inode, buf); +@@ -1726,11 +1950,16 @@ mdc_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this, + + local = frame->local; + +- if (op_ret != 0) ++ if (!local) + goto out; + +- if (!local) ++ if (op_ret != 0) { ++ if ((op_errno == ESTALE) || (op_errno == ENOENT)) { ++ mdc_inode_iatt_invalidate (this, local->loc.parent); ++ } ++ + goto out; ++ } + + if (local->loc.parent) { + mdc_inode_iatt_set (this, local->loc.parent, postparent); +@@ -1774,8 +2003,14 @@ mdc_open_cbk (call_frame_t *frame, void *cookie, xlator_t *this, + + local = frame->local; + +- if (op_ret || !local) ++ if (!local) ++ goto out; ++ ++ if (op_ret != 0) { ++ if ((op_errno == ESTALE) || (op_errno == ENOENT)) ++ mdc_inode_iatt_invalidate (this, local->loc.inode); + goto out; ++ } + + if (local->fd->flags & O_TRUNC) { + /* O_TRUNC modifies file size. Hence invalidate the +@@ -1821,12 +2056,14 @@ mdc_readv_cbk (call_frame_t *frame, void *cookie, xlator_t *this, + mdc_local_t *local = NULL; + + local = frame->local; +- +- if (op_ret < 0) ++ if (!local) + goto out; + +- if (!local) ++ if (op_ret < 0) { ++ if ((op_errno == ENOENT) || (op_errno == ESTALE)) ++ mdc_inode_iatt_invalidate (this, local->fd->inode); + goto out; ++ } + + mdc_inode_iatt_set (this, local->fd->inode, stbuf); + +@@ -1863,12 +2100,14 @@ mdc_writev_cbk (call_frame_t *frame, void *cookie, xlator_t *this, + mdc_local_t *local = NULL; + + local = frame->local; +- +- if (op_ret == -1) ++ if (!local) + goto out; + +- if (!local) ++ if (op_ret == -1) { ++ if ((op_errno == ENOENT) || (op_errno == ESTALE)) ++ mdc_inode_iatt_invalidate (this, local->fd->inode); + goto out; ++ } + + mdc_inode_iatt_set_validate(this, local->fd->inode, prebuf, postbuf, + _gf_true); +@@ -1952,12 +2191,14 @@ mdc_fsetattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, + mdc_local_t *local = NULL; + + local = frame->local; +- +- if (op_ret != 0) ++ if (!local) + goto out; + +- if (!local) ++ if (op_ret != 0) { ++ if ((op_errno == ESTALE) || (op_errno == ENOENT)) ++ mdc_inode_iatt_invalidate (this, local->fd->inode); + goto out; ++ } + + mdc_inode_iatt_set_validate(this, local->fd->inode, prebuf, postbuf, + _gf_true); +@@ -1995,12 +2236,14 @@ mdc_fsync_cbk (call_frame_t *frame, void *cookie, xlator_t *this, + mdc_local_t *local = NULL; + + local = frame->local; +- +- if (op_ret != 0) ++ if (!local) + goto out; + +- if (!local) ++ if (op_ret != 0) { ++ if ((op_errno == ENOENT) || (op_errno == ESTALE)) ++ mdc_inode_iatt_invalidate (this, local->fd->inode); + goto out; ++ } + + mdc_inode_iatt_set_validate(this, local->fd->inode, prebuf, postbuf, + _gf_true); +@@ -2037,12 +2280,14 @@ mdc_setxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, + mdc_local_t *local = NULL; + + local = frame->local; +- +- if (op_ret != 0) ++ if (!local) + goto out; + +- if (!local) ++ if (op_ret != 0) { ++ if ((op_errno == ENOENT) || (op_errno == ESTALE)) ++ mdc_inode_iatt_invalidate (this, local->loc.inode); + goto out; ++ } + + mdc_inode_xatt_update (this, local->loc.inode, local->xattr); + +@@ -2080,12 +2325,14 @@ mdc_fsetxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, + mdc_local_t *local = NULL; + + local = frame->local; +- +- if (op_ret != 0) ++ if (!local) + goto out; + +- if (!local) ++ if (op_ret != 0) { ++ if ((op_errno == ESTALE) || (op_errno == ENOENT)) ++ mdc_inode_iatt_invalidate (this, local->fd->inode); + goto out; ++ } + + mdc_inode_xatt_update (this, local->fd->inode, local->xattr); + +@@ -2121,13 +2368,16 @@ mdc_getxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, + { + mdc_local_t *local = NULL; + +- if (op_ret < 0) +- goto out; +- + local = frame->local; + if (!local) + goto out; + ++ if (op_ret < 0) { ++ if ((op_errno == ENOENT) || (op_errno == ESTALE)) ++ mdc_inode_iatt_invalidate (this, local->loc.inode); ++ goto out; ++ } ++ + mdc_inode_xatt_update (this, local->loc.inode, xattr); + + out: +@@ -2186,13 +2436,16 @@ mdc_fgetxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, + { + mdc_local_t *local = NULL; + +- if (op_ret < 0) +- goto out; +- + local = frame->local; + if (!local) + goto out; + ++ if (op_ret < 0) { ++ if ((op_errno == ENOENT) || (op_errno == ESTALE)) ++ mdc_inode_iatt_invalidate (this, local->fd->inode); ++ goto out; ++ } ++ + mdc_inode_xatt_update (this, local->fd->inode, xattr); + + out: +@@ -2250,12 +2503,14 @@ mdc_removexattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, + mdc_local_t *local = NULL; + + local = frame->local; +- +- if (op_ret != 0) ++ if (!local) + goto out; + +- if (!local) ++ if (op_ret != 0) { ++ if ((op_errno == ENOENT) || (op_errno == ESTALE)) ++ mdc_inode_iatt_invalidate (this, local->loc.inode); + goto out; ++ } + + if (local->key) + mdc_inode_xatt_unset (this, local->loc.inode, local->key); +@@ -2319,12 +2574,14 @@ mdc_fremovexattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, + mdc_local_t *local = NULL; + + local = frame->local; +- +- if (op_ret != 0) ++ if (!local) + goto out; + +- if (!local) ++ if (op_ret != 0) { ++ if ((op_errno == ENOENT) || (op_errno == ESTALE)) ++ mdc_inode_iatt_invalidate (this, local->fd->inode); + goto out; ++ } + + if (local->key) + mdc_inode_xatt_unset (this, local->fd->inode, local->key); +@@ -2379,6 +2636,28 @@ uncached: + return 0; + } + ++int32_t ++mdc_opendir_cbk (call_frame_t *frame, void *cookie, xlator_t *this, ++ int32_t op_ret, int32_t op_errno, fd_t *fd, ++ dict_t *xdata) ++{ ++ mdc_local_t *local = NULL; ++ ++ local = frame->local; ++ if (!local) ++ goto out; ++ ++ if (op_ret == 0) ++ goto out; ++ ++ if ((op_errno == ESTALE) || (op_errno == ENOENT)) ++ mdc_inode_iatt_invalidate (this, local->loc.inode); ++ ++out: ++ MDC_STACK_UNWIND (opendir, frame, op_ret, op_errno, fd, xdata); ++ return 0; ++} ++ + + int + mdc_opendir(call_frame_t *frame, xlator_t *this, loc_t *loc, +@@ -2387,6 +2666,11 @@ mdc_opendir(call_frame_t *frame, xlator_t *this, loc_t *loc, + int ret = -1; + char *mdc_key_names = NULL; + dict_t *xattr_alloc = NULL; ++ mdc_local_t *local = NULL; ++ ++ local = mdc_local_get (frame); ++ ++ loc_copy (&local->loc, loc); + + if (!xdata) + xdata = xattr_alloc = dict_new (); +@@ -2404,7 +2688,7 @@ mdc_opendir(call_frame_t *frame, xlator_t *this, loc_t *loc, + } + + wind: +- STACK_WIND (frame, default_opendir_cbk, FIRST_CHILD(this), ++ STACK_WIND (frame, mdc_opendir_cbk, FIRST_CHILD(this), + FIRST_CHILD(this)->fops->opendir, loc, fd, xdata); + + if (xattr_alloc) +@@ -2418,10 +2702,19 @@ int + mdc_readdirp_cbk (call_frame_t *frame, void *cookie, xlator_t *this, + int op_ret, int op_errno, gf_dirent_t *entries, dict_t *xdata) + { +- gf_dirent_t *entry = NULL; ++ gf_dirent_t *entry = NULL; ++ mdc_local_t *local = NULL; ++ ++ local = frame->local; ++ if (!local) ++ goto unwind; + +- if (op_ret <= 0) ++ if (op_ret <= 0) { ++ if ((op_ret == -1) && ((op_errno == ENOENT) ++ || (op_errno == ESTALE))) ++ mdc_inode_iatt_invalidate (this, local->fd->inode); + goto unwind; ++ } + + list_for_each_entry (entry, &entries->list, list) { + if (!entry->inode) +@@ -2431,7 +2724,7 @@ mdc_readdirp_cbk (call_frame_t *frame, void *cookie, xlator_t *this, + } + + unwind: +- STACK_UNWIND_STRICT (readdirp, frame, op_ret, op_errno, entries, xdata); ++ MDC_STACK_UNWIND (readdirp, frame, op_ret, op_errno, entries, xdata); + return 0; + } + +@@ -2440,7 +2733,14 @@ int + mdc_readdirp (call_frame_t *frame, xlator_t *this, fd_t *fd, + size_t size, off_t offset, dict_t *xdata) + { +- dict_t *xattr_alloc = NULL; ++ dict_t *xattr_alloc = NULL; ++ mdc_local_t *local = NULL; ++ ++ local = mdc_local_get (frame); ++ if (!local) ++ goto out; ++ ++ local->fd = fd_ref (fd); + + if (!xdata) + xdata = xattr_alloc = dict_new (); +@@ -2453,13 +2753,28 @@ mdc_readdirp (call_frame_t *frame, xlator_t *this, fd_t *fd, + if (xattr_alloc) + dict_unref (xattr_alloc); + return 0; ++out: ++ STACK_UNWIND_STRICT (readdirp, frame, -1, ENOMEM, NULL, NULL); ++ return 0; + } + + int + mdc_readdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, + int op_errno, gf_dirent_t *entries, dict_t *xdata) + { +- STACK_UNWIND_STRICT (readdir, frame, op_ret, op_errno, entries, xdata); ++ mdc_local_t *local = NULL; ++ ++ local = frame->local; ++ if (!local) ++ goto out; ++ ++ if (op_ret == 0) ++ goto out; ++ ++ if ((op_errno == ESTALE) || (op_errno == ENOENT)) ++ mdc_inode_iatt_invalidate (this, local->fd->inode); ++out: ++ MDC_STACK_UNWIND (readdir, frame, op_ret, op_errno, entries, xdata); + return 0; + } + +@@ -2467,8 +2782,15 @@ int + mdc_readdir (call_frame_t *frame, xlator_t *this, fd_t *fd, + size_t size, off_t offset, dict_t *xdata) + { +- int need_unref = 0; +- struct mdc_conf *conf = this->private; ++ int need_unref = 0; ++ mdc_local_t *local = NULL; ++ struct mdc_conf *conf = this->private; ++ ++ local = mdc_local_get (frame); ++ if (!local) ++ goto unwind; ++ ++ local->fd = fd_ref (fd); + + if (!conf->force_readdirp) { + STACK_WIND(frame, mdc_readdir_cbk, FIRST_CHILD(this), +@@ -2493,6 +2815,9 @@ mdc_readdir (call_frame_t *frame, xlator_t *this, fd_t *fd, + dict_unref (xdata); + + return 0; ++unwind: ++ MDC_STACK_UNWIND (readdir, frame, -1, ENOMEM, NULL, NULL); ++ return 0; + } + + int +@@ -2503,12 +2828,14 @@ mdc_fallocate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + mdc_local_t *local = NULL; + + local = frame->local; +- +- if (op_ret != 0) ++ if (!local) + goto out; + +- if (!local) ++ if (op_ret != 0) { ++ if ((op_errno == ENOENT) || (op_errno == ESTALE)) ++ mdc_inode_iatt_invalidate (this, local->fd->inode); + goto out; ++ } + + mdc_inode_iatt_set_validate(this, local->fd->inode, prebuf, postbuf, + _gf_true); +@@ -2543,12 +2870,14 @@ mdc_discard_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + mdc_local_t *local = NULL; + + local = frame->local; +- +- if (op_ret != 0) ++ if (!local) + goto out; + +- if (!local) ++ if (op_ret != 0) { ++ if ((op_errno == ENOENT) || (op_errno == ESTALE)) ++ mdc_inode_iatt_invalidate (this, local->fd->inode); + goto out; ++ } + + mdc_inode_iatt_set_validate(this, local->fd->inode, prebuf, postbuf, + _gf_true); +@@ -2583,12 +2912,14 @@ mdc_zerofill_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + mdc_local_t *local = NULL; + + local = frame->local; +- +- if (op_ret != 0) ++ if (!local) + goto out; + +- if (!local) ++ if (op_ret != 0) { ++ if ((op_errno == ENOENT) || (op_errno == ESTALE)) ++ mdc_inode_iatt_invalidate (this, local->fd->inode); + goto out; ++ } + + mdc_inode_iatt_set_validate(this, local->fd->inode, prebuf, postbuf, + _gf_true); +@@ -2615,6 +2946,137 @@ int mdc_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, + return 0; + } + ++int32_t ++mdc_readlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this, ++ int32_t op_ret, int32_t op_errno, const char *path, ++ struct iatt *buf, dict_t *xdata) ++{ ++ mdc_local_t *local = NULL; ++ ++ local = frame->local; ++ if (!local) ++ goto out; ++ ++ if (op_ret == 0) ++ goto out; ++ ++ if ((op_errno == ENOENT) || (op_errno == ESTALE)) ++ mdc_inode_iatt_invalidate (this, local->loc.inode); ++ ++out: ++ MDC_STACK_UNWIND (readlink, frame, op_ret, op_errno, ++ path, buf, xdata); ++ return 0; ++} ++ ++int32_t ++mdc_readlink (call_frame_t *frame, xlator_t *this, loc_t *loc, size_t size, ++ dict_t *xdata) ++{ ++ mdc_local_t *local = NULL; ++ ++ local = mdc_local_get (frame); ++ if (!local) ++ goto unwind; ++ ++ loc_copy (&local->loc, loc); ++ ++ STACK_WIND (frame, mdc_readlink_cbk, FIRST_CHILD(this), ++ FIRST_CHILD(this)->fops->readlink, ++ loc, size, xdata); ++ return 0; ++ ++unwind: ++ MDC_STACK_UNWIND (readlink, frame, -1, ENOMEM, NULL, NULL, NULL); ++ return 0; ++} ++ ++int32_t ++mdc_fsyncdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this, ++ int32_t op_ret, int32_t op_errno, dict_t *xdata) ++{ ++ mdc_local_t *local = NULL; ++ ++ local = frame->local; ++ if (!local) ++ goto out; ++ ++ if (op_ret == 0) ++ goto out; ++ ++ if ((op_errno == ESTALE) || (op_errno == ENOENT)) ++ mdc_inode_iatt_invalidate (this, local->fd->inode); ++ ++out: ++ MDC_STACK_UNWIND (fsyncdir, frame, op_ret, op_errno, xdata); ++ return 0; ++} ++ ++int32_t ++mdc_fsyncdir (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t flags, ++ dict_t *xdata) ++{ ++ mdc_local_t *local = NULL; ++ ++ local = mdc_local_get (frame); ++ if (!local) ++ goto unwind; ++ ++ local->fd = fd_ref (fd); ++ ++ STACK_WIND (frame, mdc_fsyncdir_cbk, FIRST_CHILD(this), ++ FIRST_CHILD(this)->fops->fsyncdir, fd, flags, xdata); ++ return 0; ++ ++unwind: ++ MDC_STACK_UNWIND (fsyncdir, frame, -1, ENOMEM, NULL); ++ return 0; ++} ++ ++int32_t ++mdc_access_cbk (call_frame_t *frame, void *cookie, xlator_t *this, ++ int32_t op_ret, int32_t op_errno, dict_t *xdata) ++{ ++ mdc_local_t *local = NULL; ++ ++ local = frame->local; ++ if (!local) ++ goto out; ++ ++ if (op_ret == 0) ++ goto out; ++ ++ if ((op_errno == ESTALE) || (op_errno == ENOENT)) ++ mdc_inode_iatt_invalidate (this, local->loc.inode); ++ ++out: ++ MDC_STACK_UNWIND (access, frame, op_ret, op_errno, xdata); ++ return 0; ++} ++ ++ ++ ++int32_t ++mdc_access (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t mask, ++ dict_t *xdata) ++{ ++ mdc_local_t *local = NULL; ++ ++ local = mdc_local_get (frame); ++ if (!local) ++ goto unwind; ++ ++ loc_copy (&local->loc, loc); ++ ++ STACK_WIND (frame, mdc_access_cbk, FIRST_CHILD(this), ++ FIRST_CHILD(this)->fops->access, loc, mask, xdata); ++ return 0; ++ ++unwind: ++ MDC_STACK_UNWIND (access, frame, -1, ENOMEM, NULL); ++ return 0; ++} ++ + + int + mdc_priv_dump (xlator_t *this) +@@ -3150,6 +3612,10 @@ struct xlator_fops fops = { + .fallocate = mdc_fallocate, + .discard = mdc_discard, + .zerofill = mdc_zerofill, ++ .statfs = mdc_statfs, ++ .readlink = mdc_readlink, ++ .fsyncdir = mdc_fsyncdir, ++ .access = mdc_access, + }; + + +-- +1.8.3.1 + diff --git a/0249-cluster-dht-unwind-if-dht_selfheal_dir_mkdir-returns.patch b/0249-cluster-dht-unwind-if-dht_selfheal_dir_mkdir-returns.patch new file mode 100644 index 0000000..f03d53c --- /dev/null +++ b/0249-cluster-dht-unwind-if-dht_selfheal_dir_mkdir-returns.patch @@ -0,0 +1,46 @@ +From 0e9d29c1ae1ba6954299489012ba69466709af0f Mon Sep 17 00:00:00 2001 +From: Raghavendra G +Date: Thu, 3 May 2018 09:34:39 +0530 +Subject: [PATCH 249/260] cluster/dht: unwind if dht_selfheal_dir_mkdir returns + an error + +If dht_selfheal_dir_mkdir returns an error, cbk passed to +dht_selfheal_directory is not invoked. So, Current codepath leaves an +unwound frame resulting in a hung fop forever. + +> Change-Id: I422308b8a34a074301ca46b029ffe676f5e0f66c +> fixes: bz#1574305 +> Signed-off-by: Raghavendra G + +upstream patch: https://review.gluster.org/19953/ +Signed-off-by: Raghavendra G + +Change-Id: I3ea6510d936eca6198147704d93580bd733eaeea +BUG: 1561999 +Reviewed-on: https://code.engineering.redhat.com/gerrit/137725 +Tested-by: RHGS Build Bot +Reviewed-by: Nithya Balachandran +--- + xlators/cluster/dht/src/dht-selfheal.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/xlators/cluster/dht/src/dht-selfheal.c b/xlators/cluster/dht/src/dht-selfheal.c +index 7b192d3..53c59a2 100644 +--- a/xlators/cluster/dht/src/dht-selfheal.c ++++ b/xlators/cluster/dht/src/dht-selfheal.c +@@ -2336,7 +2336,11 @@ dht_selfheal_directory (call_frame_t *frame, dht_selfheal_dir_cbk_t dir_cbk, + local->heal_layout = _gf_false; + } + +- dht_selfheal_dir_mkdir (frame, loc, layout, 0); ++ ret = dht_selfheal_dir_mkdir (frame, loc, layout, 0); ++ if (ret < 0) { ++ ret = 0; ++ goto sorry_no_fix; ++ } + + return 0; + +-- +1.8.3.1 + diff --git a/0250-cluster-dht-act-as-passthrough-for-renames-on-single.patch b/0250-cluster-dht-act-as-passthrough-for-renames-on-single.patch new file mode 100644 index 0000000..72262e9 --- /dev/null +++ b/0250-cluster-dht-act-as-passthrough-for-renames-on-single.patch @@ -0,0 +1,69 @@ +From 4eef56dc01a9ab11d56f30dd29e2eb65c82cc01d Mon Sep 17 00:00:00 2001 +From: Raghavendra G +Date: Wed, 4 Apr 2018 10:03:18 +0530 +Subject: [PATCH 250/260] cluster/dht: act as passthrough for renames on single + child DHT + +Various synchronization present in dht_rename while handling +directories and files is necessary only if we have more than only one +child. + +> Change-Id: Ie21ad419125504ca2f391b1ae2e5c1d166fee247 +> fixes: bz#1563511 +> Signed-off-by: Raghavendra G + +upstream patch: https://review.gluster.org/19817/ +Change-Id: Ie21ad419125504ca2f391b1ae2e5c1d166fee247 +BUG: 1572087 +fixes: bz#1572087 +Signed-off-by: Raghavendra G +Reviewed-on: https://code.engineering.redhat.com/gerrit/137257 +Tested-by: RHGS Build Bot +Reviewed-by: Nithya Balachandran +--- + xlators/cluster/dht/src/dht-rename.c | 22 +++++++++++++++------- + 1 file changed, 15 insertions(+), 7 deletions(-) + +diff --git a/xlators/cluster/dht/src/dht-rename.c b/xlators/cluster/dht/src/dht-rename.c +index ca6b5f4..5a72c1f 100644 +--- a/xlators/cluster/dht/src/dht-rename.c ++++ b/xlators/cluster/dht/src/dht-rename.c +@@ -1690,13 +1690,14 @@ int + dht_rename (call_frame_t *frame, xlator_t *this, + loc_t *oldloc, loc_t *newloc, dict_t *xdata) + { +- xlator_t *src_cached = NULL; +- xlator_t *src_hashed = NULL; +- xlator_t *dst_cached = NULL; +- xlator_t *dst_hashed = NULL; +- int op_errno = -1; +- int ret = -1; +- dht_local_t *local = NULL; ++ xlator_t *src_cached = NULL; ++ xlator_t *src_hashed = NULL; ++ xlator_t *dst_cached = NULL; ++ xlator_t *dst_hashed = NULL; ++ int op_errno = -1; ++ int ret = -1; ++ dht_local_t *local = NULL; ++ dht_conf_t *conf = NULL; + char gfid[GF_UUID_BUF_SIZE] = {0}; + + VALIDATE_OR_GOTO (frame, err); +@@ -1704,6 +1705,13 @@ dht_rename (call_frame_t *frame, xlator_t *this, + VALIDATE_OR_GOTO (oldloc, err); + VALIDATE_OR_GOTO (newloc, err); + ++ conf = this->private; ++ ++ if (conf->subvolume_cnt == 1) { ++ default_rename (frame, this, oldloc, newloc, xdata); ++ return 0; ++ } ++ + gf_uuid_unparse(oldloc->inode->gfid, gfid); + + src_hashed = dht_subvol_get_hashed (this, oldloc); +-- +1.8.3.1 + diff --git a/0251-dht-gf_defrag_settle_hash-should-ignore-ENOENT-and-E.patch b/0251-dht-gf_defrag_settle_hash-should-ignore-ENOENT-and-E.patch new file mode 100644 index 0000000..5fb0d61 --- /dev/null +++ b/0251-dht-gf_defrag_settle_hash-should-ignore-ENOENT-and-E.patch @@ -0,0 +1,52 @@ +From c5401605f80c2630e39b283f10b7da92ff777863 Mon Sep 17 00:00:00 2001 +From: Susant Palai +Date: Fri, 27 Apr 2018 16:40:02 +0530 +Subject: [PATCH 251/260] dht: gf_defrag_settle_hash should ignore ENOENT and + ESTALE error + +Problem: A directory deletion can happen just before gf_defrag_settle_hash +which internally does a setxattr operation on a directory. + +Solution: Ignore ENOENT and ESTALE errors + +> Fixes: bz#1572581 +> Change-Id: I2f91809f3b5e02976c4c3a5a596406a8b2f8f6f2 +> Signed-off-by: Susant Palai +(cherry picked from commit e2fda098112803bf651c4795952376cb8c1ad204) + +upstream patch: https://review.gluster.org/#/c/19945/ + +BUG: 1572585 +Change-Id: I2f91809f3b5e02976c4c3a5a596406a8b2f8f6f2 +Signed-off-by: Susant Palai +Reviewed-on: https://code.engineering.redhat.com/gerrit/137527 +Tested-by: RHGS Build Bot +Reviewed-by: Nithya Balachandran +--- + xlators/cluster/dht/src/dht-rebalance.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/xlators/cluster/dht/src/dht-rebalance.c b/xlators/cluster/dht/src/dht-rebalance.c +index eee00b8..51af11c 100644 +--- a/xlators/cluster/dht/src/dht-rebalance.c ++++ b/xlators/cluster/dht/src/dht-rebalance.c +@@ -3493,8 +3493,15 @@ gf_defrag_settle_hash (xlator_t *this, gf_defrag_info_t *defrag, + + ret = syncop_setxattr (this, loc, fix_layout, 0, NULL, NULL); + if (ret) { +- gf_log (this->name, GF_LOG_ERROR, ++ gf_msg (this->name, GF_LOG_ERROR, -ret, ++ DHT_MSG_LAYOUT_FIX_FAILED, + "fix layout on %s failed", loc->path); ++ ++ if (-ret == ENOENT || -ret == ESTALE) { ++ /* Dir most likely is deleted */ ++ return 0; ++ } ++ + return -1; + } + +-- +1.8.3.1 + diff --git a/0252-glusterd-ganesha-Skip-non-ganesha-nodes-properly-for.patch b/0252-glusterd-ganesha-Skip-non-ganesha-nodes-properly-for.patch new file mode 100644 index 0000000..b7e1af3 --- /dev/null +++ b/0252-glusterd-ganesha-Skip-non-ganesha-nodes-properly-for.patch @@ -0,0 +1,60 @@ +From 90d143d0011c15a5a334946cb628b5415825c786 Mon Sep 17 00:00:00 2001 +From: Jiffin Tony Thottan +Date: Mon, 30 Apr 2018 12:35:01 +0530 +Subject: [PATCH 252/260] glusterd/ganesha : Skip non-ganesha nodes properly + for ganesha HA set up + +Label: BACKPORT FROM UPSTREAM 3.10 + +Upstream reference: +>Patch unlink https://review.gluster.org/#/c/19949/ +>Change-Id: Iff7bc3ead43e97847219c5a5cc8b967bf0967903 +>BUG: 1573078 +>Signed-off-by: Jiffin Tony Thottan + +Change-Id: Iff7bc3ead43e97847219c5a5cc8b967bf0967903 +BUG: 1570541 +Signed-off-by: Jiffin Tony Thottan +Reviewed-on: https://code.engineering.redhat.com/gerrit/137768 +Tested-by: RHGS Build Bot +Reviewed-by: Kaleb Keithley +Reviewed-by: Sunil Kumar Heggodu Gopala Acharya +--- + xlators/mgmt/glusterd/src/glusterd-ganesha.c | 21 ++++++++++++--------- + 1 file changed, 12 insertions(+), 9 deletions(-) + +diff --git a/xlators/mgmt/glusterd/src/glusterd-ganesha.c b/xlators/mgmt/glusterd/src/glusterd-ganesha.c +index b130d5e..ae7485f 100644 +--- a/xlators/mgmt/glusterd/src/glusterd-ganesha.c ++++ b/xlators/mgmt/glusterd/src/glusterd-ganesha.c +@@ -834,15 +834,18 @@ pre_setup (gf_boolean_t run_setup, char **op_errstr) + { + int ret = 0; + +- if (check_host_list()) { +- ret = setup_cluster(run_setup); +- if (ret == -1) +- gf_asprintf (op_errstr, "Failed to set up HA " +- "config for NFS-Ganesha. " +- "Please check the log file for details"); +- } else +- ret = -1; +- ++ if (run_setup) { ++ if (!check_host_list()) { ++ gf_asprintf (op_errstr, "Running nfs-ganesha setup command " ++ "from node which is not part of ganesha cluster"); ++ return -1; ++ } ++ } ++ ret = setup_cluster(run_setup); ++ if (ret == -1) ++ gf_asprintf (op_errstr, "Failed to set up HA " ++ "config for NFS-Ganesha. " ++ "Please check the log file for details"); + return ret; + } + +-- +1.8.3.1 + diff --git a/0253-geo-rep-Fix-upgrade-issue.patch b/0253-geo-rep-Fix-upgrade-issue.patch new file mode 100644 index 0000000..ad18708 --- /dev/null +++ b/0253-geo-rep-Fix-upgrade-issue.patch @@ -0,0 +1,59 @@ +From 2d1c394b7ea9913c69445d865fb8762ecb4917ce Mon Sep 17 00:00:00 2001 +From: Kotresh HR +Date: Mon, 7 May 2018 01:23:46 -0400 +Subject: [PATCH 253/260] geo-rep: Fix upgrade issue + +Cause and Analysis: +The last synced changelog for entry operations is +marked in current version to avoid re-processing +of already processed entry operations in a batch +during crash/restart of geo-rep. This was not +present in previous versoins. + +The marker is maintained in the dictionary with the +key 'last_synced_entry' and dictionary is persisted +into status file. So upgrading to current version in +which the marker is present was failing with KeyError. + +Solution: +Load the dictionary with default keys first which +contains all the keys including latest ones and then +load the values from status file instead of doing +otherwise. + +Upstream reference: + > fixes: bz#1575490 + > Patch: https://review.gluster.org/19969 + +BUG: 1569490 +Change-Id: Ic654e6f9a3c97f616761f1362f890352a2186fb4 +Signed-off-by: Kotresh HR +Reviewed-on: https://code.engineering.redhat.com/gerrit/137909 +Tested-by: RHGS Build Bot +Reviewed-by: Sunil Kumar Heggodu Gopala Acharya +--- + geo-replication/syncdaemon/gsyncdstatus.py | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/geo-replication/syncdaemon/gsyncdstatus.py b/geo-replication/syncdaemon/gsyncdstatus.py +index 38ca92c..909c669 100644 +--- a/geo-replication/syncdaemon/gsyncdstatus.py ++++ b/geo-replication/syncdaemon/gsyncdstatus.py +@@ -152,11 +152,12 @@ class GeorepStatus(object): + **kwargs) + + def _update(self, mergerfunc): ++ data = self.default_values + with LockedOpen(self.filename, 'r+') as f: + try: +- data = json.load(f) ++ data.update(json.load(f)) + except ValueError: +- data = self.default_values ++ pass + + data = mergerfunc(data) + # If Data is not changed by merger func +-- +1.8.3.1 + diff --git a/0254-posix-Avoid-changelog-retries-for-geo-rep.patch b/0254-posix-Avoid-changelog-retries-for-geo-rep.patch new file mode 100644 index 0000000..dca47e2 --- /dev/null +++ b/0254-posix-Avoid-changelog-retries-for-geo-rep.patch @@ -0,0 +1,99 @@ +From 2de9ac218241648f1ec86b73aac728d713862a30 Mon Sep 17 00:00:00 2001 +From: moagrawa +Date: Fri, 4 May 2018 16:17:42 +0530 +Subject: [PATCH 254/260] posix: Avoid changelog retries for geo-rep + +Problem: georep is slowdown to migrate directory + from master volume to slave volume due to lot + of changelog retries + +Solution: Update the condition in posix_getxattr to + ignore MDS_INTERNAL_XATTR as it(posix) ignored + other internal xattrs + +> BUG: 1571069 +> Change-Id: I4d91ec73e5b1ca1cb3ecf0825ab9f49e261da70e +> fixes: bz#1571069 +> Signed-off-by: Mohit Agrawal +> (cherry picked from commit f46047ea0f36084f4456887673552a01b926382d) +> (Reviewed on: https://review.gluster.org/#/c/19930/) + +BUG: 1565577 +Change-Id: I85b2e8ed4adcbe34ee5a03acd068693978e9cfe4 +Signed-off-by: moagrawa +Reviewed-on: https://code.engineering.redhat.com/gerrit/137779 +Tested-by: RHGS Build Bot +Reviewed-by: Kotresh Hiremath Ravishankar +Reviewed-by: Sunil Kumar Heggodu Gopala Acharya +--- + xlators/storage/posix/src/posix.c | 33 +++++++++++++++++++++++++++++++++ + 1 file changed, 33 insertions(+) + +diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c +index c680e3f..416d9e4 100644 +--- a/xlators/storage/posix/src/posix.c ++++ b/xlators/storage/posix/src/posix.c +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include + + #ifndef GF_BSD_HOST_OS + #include +@@ -4625,6 +4626,27 @@ out: + return ret; + } + ++gf_boolean_t ++posix_is_mds_xattr (const char *name) ++{ ++ regex_t regcmpl; ++ char *key = {"trusted.glusterfs.*.mds$"}; ++ regmatch_t result[1] = {{0} }; ++ gf_boolean_t status = _gf_false; ++ ++ if (regcomp (®cmpl, key, REG_EXTENDED)) { ++ goto out; ++ } ++ if (!regexec (®cmpl, name, 1, result, 0)) { ++ status = _gf_true; ++ goto out; ++ } ++out: ++ regfree(®cmpl); ++ return status; ++} ++ ++ + /** + * posix_getxattr - this function returns a dictionary with all the + * key:value pair present as xattr. used for +@@ -4680,6 +4702,13 @@ posix_getxattr (call_frame_t *frame, xlator_t *this, + goto out; + } + ++ if (name && posix_is_mds_xattr (name)) { ++ op_ret = -1; ++ op_errno = ENOATTR; ++ goto out; ++ } ++ ++ + if (loc->inode && IA_ISDIR(loc->inode->ia_type) && name && + ZR_FILE_CONTENT_REQUEST(name)) { + ret = posix_get_file_contents (this, loc->gfid, &name[15], +@@ -5049,6 +5078,10 @@ posix_getxattr (call_frame_t *frame, xlator_t *this, + goto ignore; + } + ++ if (posix_is_mds_xattr (keybuffer)) { ++ goto ignore; ++ } ++ + memset (value_buf, '\0', sizeof(value_buf)); + have_val = _gf_false; + size = sys_lgetxattr (real_path, keybuffer, value_buf, +-- +1.8.3.1 + diff --git a/0255-glusterd-update-listen-backlog-value-to-1024.patch b/0255-glusterd-update-listen-backlog-value-to-1024.patch new file mode 100644 index 0000000..9a72ffa --- /dev/null +++ b/0255-glusterd-update-listen-backlog-value-to-1024.patch @@ -0,0 +1,46 @@ +From 8b2af4ee879261ea6e690c3c52d9acc5d0a92cfd Mon Sep 17 00:00:00 2001 +From: Milind Changire +Date: Thu, 19 Apr 2018 11:18:58 +0530 +Subject: [PATCH 255/260] glusterd: update listen-backlog value to 1024 + +Update default value of listen-backlog to 1024 to reflect the changes in +socket.c + +This keeps the actual implementation in socket.c and the help text in +glusterd-volume-set.c consistent + +mainline: +> Reviewed-on: https://review.gluster.org/19874 +> fixes: bz#1564600 +> Reviewed-by: Raghavendra G +> Reviewed-by: Jeff Darcy +> Reviewed-by: Atin Mukherjee +(cherry picked from commit d9cf6d25a4719c4f6fb4d88325f08e49fca18e6b) + +Change-Id: If04c9e0bb5afb55edcc7ca57bbc10922b85b7075 +BUG: 1563804 +Signed-off-by: Milind Changire +Reviewed-on: https://code.engineering.redhat.com/gerrit/136215 +Tested-by: RHGS Build Bot +Reviewed-by: Raghavendra Gowdappa +Reviewed-by: Sunil Kumar Heggodu Gopala Acharya +--- + xlators/mgmt/glusterd/src/glusterd-volume-set.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-set.c b/xlators/mgmt/glusterd/src/glusterd-volume-set.c +index 9bc0933..b9da961 100644 +--- a/xlators/mgmt/glusterd/src/glusterd-volume-set.c ++++ b/xlators/mgmt/glusterd/src/glusterd-volume-set.c +@@ -2131,7 +2131,7 @@ struct volopt_map_entry glusterd_volopt_map[] = { + .description = "This option uses the value of backlog argument that " + "defines the maximum length to which the queue of " + "pending connections for socket fd may grow.", +- .value = "10", ++ .value = "1024", + }, + + /* Generic transport options */ +-- +1.8.3.1 + diff --git a/0256-rpc-set-listen-backlog-to-high-value.patch b/0256-rpc-set-listen-backlog-to-high-value.patch new file mode 100644 index 0000000..b7e2666 --- /dev/null +++ b/0256-rpc-set-listen-backlog-to-high-value.patch @@ -0,0 +1,57 @@ +From 4448795af501355f3893aed05551ee62551e8438 Mon Sep 17 00:00:00 2001 +From: Milind Changire +Date: Fri, 13 Apr 2018 14:51:32 +0530 +Subject: [PATCH 256/260] rpc: set listen-backlog to high value + +Problem: +On node reboot, when glusterd starts volumes rapidly, there's a flood of +connections from the bricks to glusterd and from the self-heal daemons +to the bricks. This causes SYN Flooding and dropped connections when the +listen-backlog is not enough to hold the pending connections to +compensate for the rate at which connections are accepted by the RPC +layer. + +Solution: +Increase the listen-backlog value to 1024. This is a partial solution. +Part of the solution is to rearm the listener socket early for quicker +accept() of connections. +See commit 6964640a977cb10c0c95a94e03c229918fa6eca8 (change 19833) + +mainline: +> Reviewed-on: https://review.gluster.org/19836 +> Change-Id: I56781149919dd6e18cc43884234c6f60f2c93f88 +> fixes: bz#1564600 +> Signed-off-by: Milind Changire + +Change-Id: I1d7ac940eb5410cdbf7508a24bfdfc052b35170b +BUG: 1563804 +Signed-off-by: Milind Changire +Reviewed-on: https://code.engineering.redhat.com/gerrit/135557 +Tested-by: RHGS Build Bot +Reviewed-by: Raghavendra Gowdappa +Reviewed-by: Sunil Kumar Heggodu Gopala Acharya +--- + rpc/rpc-transport/socket/src/socket.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/rpc/rpc-transport/socket/src/socket.c b/rpc/rpc-transport/socket/src/socket.c +index 157b5b7..a6be911 100644 +--- a/rpc/rpc-transport/socket/src/socket.c ++++ b/rpc/rpc-transport/socket/src/socket.c +@@ -4613,6 +4613,13 @@ struct volume_options options[] = { + .min = GF_MIN_SOCKET_WINDOW_SIZE, + .max = GF_MAX_SOCKET_WINDOW_SIZE + }, ++ { .key = {"transport.listen-backlog"}, ++ .type = GF_OPTION_TYPE_SIZET, ++ .description = "This option uses the value of backlog argument that " ++ "defines the maximum length to which the queue of " ++ "pending connections for socket fd may grow.", ++ .default_value = "1024", ++ }, + { .key = {"transport.tcp-user-timeout"}, + .type = GF_OPTION_TYPE_INT, + .default_value = "0" +-- +1.8.3.1 + diff --git a/0257-rpc-rearm-listener-socket-early.patch b/0257-rpc-rearm-listener-socket-early.patch new file mode 100644 index 0000000..9b529e4 --- /dev/null +++ b/0257-rpc-rearm-listener-socket-early.patch @@ -0,0 +1,57 @@ +From 8879d72884396de4ae2ff41649de5f2d916d272b Mon Sep 17 00:00:00 2001 +From: Milind Changire +Date: Fri, 13 Apr 2018 10:53:46 +0530 +Subject: [PATCH 257/260] rpc: rearm listener socket early + +Problem: +On node reboot, when glusterd starts volumes, a setup with a large +number of bricks might cause SYN Flooding and connections to be dropped +if the connections are not accepted quickly enough. + +Solution: +accept() the connection and rearm the listener socket early to receive +more connection requests as soon as possible. + +mainline: +> Reviewed-on: https://review.gluster.org/19833 +> Change-Id: Ibed421e50284c3f7a8fcdb4de7ac86cf53d4b74e +> fixes: bz#1564600 +> Signed-off-by: Milind Changire + +Change-Id: I4bf45b8a12f738ed9b398246e22dfd29e6b1010c +BUG: 1563804 +Signed-off-by: Milind Changire +Reviewed-on: https://code.engineering.redhat.com/gerrit/135513 +Tested-by: RHGS Build Bot +Reviewed-by: Raghavendra Gowdappa +Reviewed-by: Sunil Kumar Heggodu Gopala Acharya +--- + rpc/rpc-transport/socket/src/socket.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/rpc/rpc-transport/socket/src/socket.c b/rpc/rpc-transport/socket/src/socket.c +index a6be911..b98efdc 100644 +--- a/rpc/rpc-transport/socket/src/socket.c ++++ b/rpc/rpc-transport/socket/src/socket.c +@@ -2746,6 +2746,9 @@ socket_server_event_handler (int fd, int idx, int gen, void *data, + if (poll_in) { + new_sock = accept (priv->sock, SA (&new_sockaddr), &addrlen); + ++ if (ctx) ++ event_handled (ctx->event_pool, fd, idx, gen); ++ + if (new_sock == -1) { + gf_log (this->name, GF_LOG_WARNING, + "accept on %d failed (%s)", +@@ -2968,8 +2971,6 @@ socket_server_event_handler (int fd, int idx, int gen, void *data, + } + } + out: +- event_handled (ctx->event_pool, fd, idx, gen); +- + if (cname && (cname != this->ssl_name)) { + GF_FREE(cname); + } +-- +1.8.3.1 + diff --git a/0258-cluster-dht-log-error-only-if-layout-healing-is-requ.patch b/0258-cluster-dht-log-error-only-if-layout-healing-is-requ.patch new file mode 100644 index 0000000..f93bf13 --- /dev/null +++ b/0258-cluster-dht-log-error-only-if-layout-healing-is-requ.patch @@ -0,0 +1,286 @@ +From 9ac423d71b9d9d8875ce2af29e2bcf5770b61d5a Mon Sep 17 00:00:00 2001 +From: Raghavendra G +Date: Fri, 16 Mar 2018 12:16:43 +0530 +Subject: [PATCH 258/260] cluster/dht: log error only if layout healing is + required + +selfhealing of directory is invoked on two conditions: +1. no layout on disk or layout has some anomalies (holes/overlaps) +2. mds xattr is not set on the directory + +When dht_selfheal_directory is called with a correct layout just to +set mds xattr, we see error msgs complaining about "not able to form +layout on directory", which is misleading as the layout is +correct. So, log this msg only if layout has anomalies. + +>Change-Id: I4af25246fc3a2450c2426e9902d1a5b372eab125 +>updates: bz#1543279 +>BUG: 1543279 +>Signed-off-by: Raghavendra G + +upstream patch: https://review.gluster.org/19727 +BUG: 1567100 +Change-Id: I169823ec3d4455c43f575e6c4ec0735aceb54e6b +Signed-off-by: Raghavendra G +Reviewed-on: https://code.engineering.redhat.com/gerrit/138149 +Tested-by: RHGS Build Bot +Reviewed-by: Sunil Kumar Heggodu Gopala Acharya +--- + xlators/cluster/dht/src/dht-common.h | 1 + + xlators/cluster/dht/src/dht-selfheal.c | 199 ++------------------------------- + 2 files changed, 12 insertions(+), 188 deletions(-) + +diff --git a/xlators/cluster/dht/src/dht-common.h b/xlators/cluster/dht/src/dht-common.h +index a785876..9d429af 100644 +--- a/xlators/cluster/dht/src/dht-common.h ++++ b/xlators/cluster/dht/src/dht-common.h +@@ -312,6 +312,7 @@ struct dht_local { + uint32_t overlaps_cnt; + uint32_t down; + uint32_t misc; ++ uint32_t missing_cnt; + dht_selfheal_dir_cbk_t dir_cbk; + dht_selfheal_layout_t healer; + dht_need_heal_t should_heal; +diff --git a/xlators/cluster/dht/src/dht-selfheal.c b/xlators/cluster/dht/src/dht-selfheal.c +index 53c59a2..5812f12 100644 +--- a/xlators/cluster/dht/src/dht-selfheal.c ++++ b/xlators/cluster/dht/src/dht-selfheal.c +@@ -359,7 +359,8 @@ dht_should_heal_layout (call_frame_t *frame, dht_layout_t **heal, + ret = dht_layout_anomalies (frame->this, &local->loc, *ondisk, + &local->selfheal.hole_cnt, + &local->selfheal.overlaps_cnt, +- NULL, &local->selfheal.down, ++ &local->selfheal.missing_cnt, ++ &local->selfheal.down, + &local->selfheal.misc, NULL); + + if (ret < 0) +@@ -1015,115 +1016,6 @@ dht_layout_index_from_conf (dht_layout_t *layout, xlator_t *xlator) + return i; + } + +- +-static int +-dht_selfheal_dir_xattr_for_nameless_lookup (call_frame_t *frame, loc_t *loc, +- dht_layout_t *layout) +-{ +- dht_local_t *local = NULL; +- int missing_xattr = 0; +- int i = 0; +- xlator_t *this = NULL; +- dht_conf_t *conf = NULL; +- dht_layout_t *dummy = NULL; +- int j = 0; +- +- local = frame->local; +- this = frame->this; +- conf = this->private; +- +- for (i = 0; i < layout->cnt; i++) { +- if (layout->list[i].err != -1 || !layout->list[i].stop) { +- /* err != -1 would mean xattr present on the directory +- or the directory is non existent. +- !layout->list[i].stop would mean layout absent +- */ +- +- continue; +- } +- missing_xattr++; +- } +- +- /* Also account for subvolumes with no-layout. Used for zero'ing out +- the layouts and for setting quota key's if present */ +- +- /* Send where either the subvol is not part of layout, +- * or it is part of the layout but error is non-zero but error +- * is not equal to -1 or ENOENT. +- */ +- +- for (i = 0; i < conf->subvolume_cnt; i++) { +- if (dht_is_subvol_part_of_layout (layout, conf->subvolumes[i]) +- == _gf_false) { +- missing_xattr++; +- continue; +- } +- +- j = dht_layout_index_from_conf (layout, conf->subvolumes[i]); +- +- if ((j != -1) && (layout->list[j].err != -1) && +- (layout->list[j].err != 0) && +- (layout->list[j].err != ENOENT)) { +- missing_xattr++; +- } +- +- } +- +- +- gf_msg_trace (this->name, 0, +- "%d subvolumes missing xattr for %s", +- missing_xattr, loc->path); +- +- if (missing_xattr == 0) { +- dht_selfheal_dir_finish (frame, this, 0, 1); +- return 0; +- } +- +- local->call_cnt = missing_xattr; +- +- if (gf_log_get_loglevel () >= GF_LOG_DEBUG) +- dht_log_new_layout_for_dir_selfheal (this, loc, layout); +- +- for (i = 0; i < layout->cnt; i++) { +- if (layout->list[i].err != -1 || !layout->list[i].stop) +- continue; +- +- dht_selfheal_dir_xattr_persubvol (frame, loc, layout, i, NULL); +- +- if (--missing_xattr == 0) +- break; +- } +- +- dummy = dht_layout_new (this, 1); +- if (!dummy) +- goto out; +- +- for (i = 0; i < conf->subvolume_cnt && missing_xattr; i++) { +- if (dht_is_subvol_part_of_layout (layout, conf->subvolumes[i]) +- == _gf_false) { +- dht_selfheal_dir_xattr_persubvol (frame, loc, dummy, 0, +- conf->subvolumes[i]); +- missing_xattr--; +- continue; +- } +- +- j = dht_layout_index_from_conf (layout, conf->subvolumes[i]); +- +- if ((j != -1) && (layout->list[j].err != -1) && +- (layout->list[j].err != ENOENT) && +- (layout->list[j].err != 0)) { +- dht_selfheal_dir_xattr_persubvol (frame, loc, dummy, 0, +- conf->subvolumes[i]); +- missing_xattr--; +- } +- } +- +- dht_layout_unref (this, dummy); +-out: +- return 0; +- +-} +- + int + dht_selfheal_dir_setattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, + int op_ret, int op_errno, struct iatt *statpre, +@@ -2296,7 +2188,8 @@ dht_selfheal_directory (call_frame_t *frame, dht_selfheal_dir_cbk_t dir_cbk, + dht_layout_anomalies (this, loc, layout, + &local->selfheal.hole_cnt, + &local->selfheal.overlaps_cnt, +- NULL, &local->selfheal.down, ++ &local->selfheal.missing_cnt, ++ &local->selfheal.down, + &local->selfheal.misc, NULL); + + down = local->selfheal.down; +@@ -2325,14 +2218,14 @@ dht_selfheal_directory (call_frame_t *frame, dht_selfheal_dir_cbk_t dir_cbk, + + dht_layout_sort_volname (layout); + local->heal_layout = _gf_true; +- ret = dht_selfheal_dir_getafix (frame, loc, layout); + +- if (ret == -1) { +- gf_msg (this->name, GF_LOG_INFO, 0, +- DHT_MSG_DIR_SELFHEAL_FAILED, +- "Directory selfheal failed: " +- "Unable to form layout for directory %s", +- loc->path); ++ /* Ignore return value as it can be inferred from result of ++ * dht_layout_anomalies ++ */ ++ dht_selfheal_dir_getafix (frame, loc, layout); ++ ++ if (!(local->selfheal.hole_cnt || local->selfheal.overlaps_cnt || ++ local->selfheal.missing_cnt)) { + local->heal_layout = _gf_false; + } + +@@ -2352,76 +2245,6 @@ sorry_no_fix: + } + + int +-dht_selfheal_directory_for_nameless_lookup (call_frame_t *frame, +- dht_selfheal_dir_cbk_t dir_cbk, +- loc_t *loc, dht_layout_t *layout) +-{ +- dht_local_t *local = NULL; +- uint32_t down = 0; +- uint32_t misc = 0; +- int ret = 0; +- xlator_t *this = NULL; +- +- local = frame->local; +- this = frame->this; +- dht_layout_anomalies (this, loc, layout, +- &local->selfheal.hole_cnt, +- &local->selfheal.overlaps_cnt, +- NULL, &local->selfheal.down, +- &local->selfheal.misc, NULL); +- +- down = local->selfheal.down; +- misc = local->selfheal.misc; +- +- local->selfheal.dir_cbk = dir_cbk; +- local->selfheal.layout = dht_layout_ref (this, layout); +- +- if (down) { +- gf_msg (this->name, GF_LOG_WARNING, 0, +- DHT_MSG_SUBVOL_DOWN_ERROR, +- "%d subvolumes down -- not fixing", down); +- ret = 0; +- goto sorry_no_fix; +- } +- +- if (misc) { +- gf_msg (this->name, GF_LOG_WARNING, 0, +- DHT_MSG_SUBVOL_ERROR, +- "%d subvolumes have unrecoverable errors", misc); +- ret = 0; +- goto sorry_no_fix; +- } +- +- dht_layout_sort_volname (layout); +- ret = dht_selfheal_dir_getafix (frame, loc, layout); +- +- if (ret == -1) { +- gf_msg (this->name, GF_LOG_WARNING, 0, +- DHT_MSG_LAYOUT_FORM_FAILED, +- "not able to form layout for the directory"); +- goto sorry_no_fix; +- } +- +- ret = dht_selfheal_layout_lock (frame, layout, _gf_false, +- dht_selfheal_dir_xattr_for_nameless_lookup, +- dht_should_heal_layout); +- +- if (ret < 0) { +- goto sorry_no_fix; +- } +- +- return 0; +- +-sorry_no_fix: +- /* TODO: need to put appropriate local->op_errno */ +- dht_selfheal_dir_finish (frame, this, ret, 1); +- +- return 0; +- +- +-} +- +-int + dht_selfheal_restore (call_frame_t *frame, dht_selfheal_dir_cbk_t dir_cbk, + loc_t *loc, dht_layout_t *layout) + { +-- +1.8.3.1 + diff --git a/0259-Quota-Turn-on-ssl-for-crawler-clients-if-needed.patch b/0259-Quota-Turn-on-ssl-for-crawler-clients-if-needed.patch new file mode 100644 index 0000000..b2619ab --- /dev/null +++ b/0259-Quota-Turn-on-ssl-for-crawler-clients-if-needed.patch @@ -0,0 +1,78 @@ +From 0652899ce703542fc7fd676f3fd80748395d7094 Mon Sep 17 00:00:00 2001 +From: Sanoj Unnikrishnan +Date: Wed, 9 May 2018 13:43:48 +0530 +Subject: [PATCH 259/260] Quota: Turn on ssl for crawler clients if needed + +Problem: Quota uses per brick client generated by +glusterd_generate_client_per_brick_volfile to crawl the +individual bricks. These clients were not being configured +with ssl if volume has client.ssl turned on. + +Solution: turn on client.ssl if the volume has client.ssl +option set to on. + +Upstream Reference: +> Change-Id: Id3a13d5110c4376d734480c42da1ce6844cc8240 +> fixes: bz#1575858 +> Reviewed on: https://review.gluster.org/#/c/19978/ + +BUG: 1557551 +Change-Id: Id3a13d5110c4376d734480c42da1ce6844cc8240 +Signed-off-by: Sanoj Unnikrishnan +Reviewed-on: https://code.engineering.redhat.com/gerrit/138158 +Reviewed-by: Hari Gowtham Gopal +Tested-by: RHGS Build Bot +Reviewed-by: Sunil Kumar Heggodu Gopala Acharya +--- + xlators/mgmt/glusterd/src/glusterd-volgen.c | 21 ++++++++++++++++++++- + 1 file changed, 20 insertions(+), 1 deletion(-) + +diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c +index 3926bd3..3d8ad77 100644 +--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c ++++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c +@@ -5726,6 +5726,8 @@ glusterd_generate_client_per_brick_volfile (glusterd_volinfo_t *volinfo) + dict_t *dict = NULL; + xlator_t *xl = NULL; + int ret = -1; ++ char *ssl_str = NULL; ++ gf_boolean_t ssl_bool = _gf_false; + + dict = dict_new (); + if (!dict) +@@ -5733,7 +5735,22 @@ glusterd_generate_client_per_brick_volfile (glusterd_volinfo_t *volinfo) + + ret = dict_set_uint32 (dict, "trusted-client", GF_CLIENT_TRUSTED); + if (ret) +- goto out; ++ goto free_dict; ++ ++ if (dict_get_str(volinfo->dict, "client.ssl", &ssl_str) == 0) { ++ if (gf_string2boolean(ssl_str, &ssl_bool) == 0) { ++ if (ssl_bool) { ++ if (dict_set_dynstr_with_alloc(dict, ++ "client.ssl", "on") != 0) { ++ ret = -1; ++ goto free_dict; ++ } ++ } ++ } else { ++ ret = -1; ++ goto free_dict; ++ } ++ } + + cds_list_for_each_entry (brick, &volinfo->bricks, brick_list) { + xl = volgen_graph_build_client (&graph, volinfo, +@@ -5760,6 +5777,8 @@ out: + if (ret) + volgen_graph_free (&graph); + ++free_dict: ++ + if (dict) + dict_unref (dict); + +-- +1.8.3.1 + diff --git a/0260-dht-Avoid-dict-log-flooding-for-internal-MDS-xattr.patch b/0260-dht-Avoid-dict-log-flooding-for-internal-MDS-xattr.patch new file mode 100644 index 0000000..b787ac3 --- /dev/null +++ b/0260-dht-Avoid-dict-log-flooding-for-internal-MDS-xattr.patch @@ -0,0 +1,44 @@ +From 1eb5f1a725cc9afdd7b1a7b29cf446b9c60974c6 Mon Sep 17 00:00:00 2001 +From: Mohit Agrawal +Date: Tue, 8 May 2018 14:52:04 +0530 +Subject: [PATCH 260/260] dht: Avoid dict log flooding for internal MDS xattr + +Problem: Before populate MDS internal xattr first dht checks if MDS is + present in xattr or not.If xattr dictionary is NULL dict_get + log the message either dict or key is NULL + +Solution: Before call dict_get check xattr, if it is NULL then no + need to call dict_get. + +> BUG: 1575910 +> Change-Id: I81604ec5945b85eba14b42f4583d06ec713028f4 +> fixes: bz#1575910 +> (cherry picked from commit ed5a09e4aea7f64f9a43698955e24285a936f0c0) +> (Upstream link https://review.gluster.org/#/c/19981/) + +BUG: 1575895 +Change-Id: I728a8068786f94d3793a91cdd5c64f813d7545ca +Signed-off-by: Mohit Agrawal +Reviewed-on: https://code.engineering.redhat.com/gerrit/138205 +Tested-by: RHGS Build Bot +Reviewed-by: Sunil Kumar Heggodu Gopala Acharya +--- + xlators/cluster/dht/src/dht-common.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c +index 3b8ba6d..a985481 100644 +--- a/xlators/cluster/dht/src/dht-common.c ++++ b/xlators/cluster/dht/src/dht-common.c +@@ -855,7 +855,7 @@ dht_common_mark_mdsxattr (call_frame_t *frame, int *errst, int mark_during_fresh + and wind a setxattr call on hashed subvol to update + internal xattr + */ +- if (!dict_get (local->xattr, conf->mds_xattr_key)) { ++ if (!local->xattr || !dict_get (local->xattr, conf->mds_xattr_key)) { + /* It means no internal MDS xattr has been set yet + */ + /* Check the status of all subvol are up while call +-- +1.8.3.1 + diff --git a/glusterfs.spec b/glusterfs.spec index df0c42e..4359966 100644 --- a/glusterfs.spec +++ b/glusterfs.spec @@ -192,7 +192,7 @@ Release: 0.1%{?prereltag:.%{prereltag}}%{?dist} %else Name: glusterfs Version: 3.12.2 -Release: 8%{?dist} +Release: 9%{?dist} %endif License: GPLv2 or LGPLv3+ Group: System Environment/Base @@ -501,6 +501,30 @@ Patch0233: 0233-libglusterfs-fix-comparison-of-a-NULL-dict-with-a-no.patch Patch0234: 0234-ec-Use-tiebreaker_inodelk-where-necessary.patch Patch0235: 0235-cluster-syncop-Implement-tiebreaker-inodelk-entrylk.patch Patch0236: 0236-cluster-syncop-Address-comments-in-3ad68df725ac32f83.patch +Patch0237: 0237-cluster-dht-Fix-dht_rename-lock-order.patch +Patch0238: 0238-quota-Build-is-failed-due-to-access-rpc-refcount-in-.patch +Patch0239: 0239-geo-rep-Fix-syncing-of-symlink.patch +Patch0240: 0240-shared-storage-Prevent-mounting-shared-storage-from-.patch +Patch0241: 0241-server-auth-add-option-for-strict-authentication.patch +Patch0242: 0242-feature-changelog-remove-unused-variable.patch +Patch0243: 0243-timer-Fix-possible-race-during-cleanup.patch +Patch0244: 0244-common-ha-All-statd-related-files-need-to-be-owned-b.patch +Patch0245: 0245-build-make-RHGS-version-available-for-server.patch +Patch0246: 0246-glusterd-Fix-for-memory-leak-in-get-state-detail.patch +Patch0247: 0247-protocol-server-unwind-as-per-op-version.patch +Patch0248: 0248-performance-md-cache-purge-cache-on-ENOENT-ESTALE-er.patch +Patch0249: 0249-cluster-dht-unwind-if-dht_selfheal_dir_mkdir-returns.patch +Patch0250: 0250-cluster-dht-act-as-passthrough-for-renames-on-single.patch +Patch0251: 0251-dht-gf_defrag_settle_hash-should-ignore-ENOENT-and-E.patch +Patch0252: 0252-glusterd-ganesha-Skip-non-ganesha-nodes-properly-for.patch +Patch0253: 0253-geo-rep-Fix-upgrade-issue.patch +Patch0254: 0254-posix-Avoid-changelog-retries-for-geo-rep.patch +Patch0255: 0255-glusterd-update-listen-backlog-value-to-1024.patch +Patch0256: 0256-rpc-set-listen-backlog-to-high-value.patch +Patch0257: 0257-rpc-rearm-listener-socket-early.patch +Patch0258: 0258-cluster-dht-log-error-only-if-layout-healing-is-requ.patch +Patch0259: 0259-Quota-Turn-on-ssl-for-crawler-clients-if-needed.patch +Patch0260: 0260-dht-Avoid-dict-log-flooding-for-internal-MDS-xattr.patch %description GlusterFS is a distributed file-system capable of scaling to several @@ -1152,6 +1176,10 @@ find ./tests ./run-tests.sh -type f | cpio -pd %{buildroot}%{_prefix}/share/glus install -p -m 0744 -D extras/command-completion/gluster.bash \ %{buildroot}%{_sysconfdir}/bash_completion.d/gluster +%if ( 0%{?_build_server} ) +echo "RHGS 3.4.0" > %{buildroot}%{_datadir}/glusterfs/release +%endif + %clean rm -rf %{buildroot} @@ -1853,6 +1881,7 @@ exit 0 # Extra utility script %dir %{_libexecdir}/glusterfs + %{_datadir}/glusterfs/release %dir %{_datadir}/glusterfs/scripts %{_datadir}/glusterfs/scripts/stop-all-gluster-processes.sh %if ( 0%{?_with_systemd:1} ) @@ -2442,6 +2471,12 @@ fi %endif %changelog +* Wed May 09 2018 Milind Changire - 3.12.2-9 +- fixes bugs bz#1546717 bz#1557551 bz#1558948 bz#1561999 bz#1563804 + bz#1565015 bz#1565119 bz#1565399 bz#1565577 bz#1567100 bz#1567899 bz#1568374 + bz#1568969 bz#1569490 bz#1570514 bz#1570541 bz#1570582 bz#1571645 bz#1572087 + bz#1572585 bz#1575895 + * Fri Apr 20 2018 Milind Changire - 3.12.2-8 - fixes bugs bz#1466129 bz#1475779 bz#1523216 bz#1535281 bz#1546941 bz#1550315 bz#1550991 bz#1553677 bz#1554291 bz#1559452 bz#1560955 bz#1562744