From 61de5f4d9d5b64d33a91dfbe15d05d1669d7c9b6 Mon Sep 17 00:00:00 2001 From: Rinku Kothiya Date: Fri, 10 Jan 2020 05:41:07 -0500 Subject: [PATCH] autobuild v6.0-26 Resolves: bz#1763208 bz#1788656 Signed-off-by: Rinku Kothiya --- ...d-ahead-io-cache-turn-off-by-default.patch | 82 +++++++ ...ging-of-write-failure-to-fuse-device.patch | 223 ++++++++++++++++++ glusterfs.spec | 7 +- 3 files changed, 311 insertions(+), 1 deletion(-) create mode 100644 0345-read-ahead-io-cache-turn-off-by-default.patch create mode 100644 0346-fuse-degrade-logging-of-write-failure-to-fuse-device.patch diff --git a/0345-read-ahead-io-cache-turn-off-by-default.patch b/0345-read-ahead-io-cache-turn-off-by-default.patch new file mode 100644 index 0000000..48b0cc8 --- /dev/null +++ b/0345-read-ahead-io-cache-turn-off-by-default.patch @@ -0,0 +1,82 @@ +From d45c64e17e1eb8003ac1086cbd3abea32414c7f9 Mon Sep 17 00:00:00 2001 +From: Raghavendra Gowdappa +Date: Tue, 12 Feb 2019 18:33:44 +0530 +Subject: [PATCH 345/346] read-ahead/io-cache: turn off by default + +We've found perf xlators io-cache and read-ahead not adding any +performance improvement. At best read-ahead is redundant due to kernel +read-ahead and at worst io-cache is degrading the performance for +workloads that doesn't involve re-read. Given that VFS already have +both these functionalities, this patch makes these two +translators turned off by default for native fuse mounts. + +For non-native fuse mounts like gfapi (NFS-ganesha/samba) we can have +these xlators on by having custom profiles. + +>Change-Id: Ie7535788909d4c741844473696f001274dc0bb60 +>Signed-off-by: Raghavendra Gowdappa +>fixes: bz#1676479 +Upstream fix link: https://review.gluster.org/#/c/glusterfs/+/22203/ + +BUG: 1788656 +Change-Id: Ie7535788909d4c741844473696f001274dc0bb60 +Signed-off-by: Sunil Kumar Acharya +Reviewed-on: https://code.engineering.redhat.com/gerrit/188967 +Tested-by: RHGS Build Bot +--- + tests/basic/ec/self-heal.t | 2 ++ + tests/basic/glusterd/volfile_server_switch.t | 2 +- + xlators/mgmt/glusterd/src/glusterd-volume-set.c | 4 ++-- + 3 files changed, 5 insertions(+), 3 deletions(-) + +diff --git a/tests/basic/ec/self-heal.t b/tests/basic/ec/self-heal.t +index d217559..6329bb6 100644 +--- a/tests/basic/ec/self-heal.t ++++ b/tests/basic/ec/self-heal.t +@@ -131,6 +131,8 @@ TEST $CLI volume create $V0 redundancy 2 $H0:$B0/${V0}{0..5} + TEST $CLI volume set $V0 client-log-level DEBUG + #Write-behind has a bug where lookup can race over write which leads to size mismatch on the mount after a 'cp' + TEST $CLI volume set $V0 performance.write-behind off ++#md-cache can return stale stat due to default timeout being 1 sec ++TEST $CLI volume set $V0 performance.stat-prefetch off + EXPECT "Created" volinfo_field $V0 'Status' + TEST $CLI volume start $V0 + EXPECT_WITHIN $PROCESS_UP_TIMEOUT "Started" volinfo_field $V0 'Status' +diff --git a/tests/basic/glusterd/volfile_server_switch.t b/tests/basic/glusterd/volfile_server_switch.t +index 3090609..e11cfed 100644 +--- a/tests/basic/glusterd/volfile_server_switch.t ++++ b/tests/basic/glusterd/volfile_server_switch.t +@@ -34,7 +34,7 @@ TEST glusterfs --volfile-id=/$V0 --volfile-server=$H1 --volfile-server=$H2 --vol + + TEST kill_glusterd 1 + +-TEST $CLI_2 volume set $V0 performance.io-cache off ++TEST $CLI_2 volume set $V0 performance.write-behind off + + # make sure by this time directory will be created + # TODO: suggest ideal time to wait +diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-set.c b/xlators/mgmt/glusterd/src/glusterd-volume-set.c +index 16601a2..9001b88 100644 +--- a/xlators/mgmt/glusterd/src/glusterd-volume-set.c ++++ b/xlators/mgmt/glusterd/src/glusterd-volume-set.c +@@ -2235,7 +2235,7 @@ struct volopt_map_entry glusterd_volopt_map[] = { + {.key = "performance.read-ahead", + .voltype = "performance/read-ahead", + .option = "!perf", +- .value = "on", ++ .value = "off", + .op_version = 1, + .description = "enable/disable read-ahead translator in the volume.", + .flags = VOLOPT_FLAG_CLIENT_OPT | VOLOPT_FLAG_XLATOR_OPT}, +@@ -2249,7 +2249,7 @@ struct volopt_map_entry glusterd_volopt_map[] = { + {.key = "performance.io-cache", + .voltype = "performance/io-cache", + .option = "!perf", +- .value = "on", ++ .value = "off", + .op_version = 1, + .description = "enable/disable io-cache translator in the volume.", + .flags = VOLOPT_FLAG_CLIENT_OPT}, +-- +1.8.3.1 + diff --git a/0346-fuse-degrade-logging-of-write-failure-to-fuse-device.patch b/0346-fuse-degrade-logging-of-write-failure-to-fuse-device.patch new file mode 100644 index 0000000..9fca79e --- /dev/null +++ b/0346-fuse-degrade-logging-of-write-failure-to-fuse-device.patch @@ -0,0 +1,223 @@ +From e2af9793014ad67859aa73088765a52307cbe466 Mon Sep 17 00:00:00 2001 +From: Csaba Henk +Date: Tue, 7 Jan 2020 19:43:05 +0100 +Subject: [PATCH 346/346] fuse: degrade logging of write failure to fuse device + +Problem: + +FUSE uses failures of communicating with /dev/fuse with various +errnos to indicate in-kernel conditions to userspace. Some of these +shouldn't be handled as an application error. Also the standard +POSIX errno description should not be shown as they are misleading +in this context. + +Solution: + +When writing to the fuse device, the caller of the respective +convenience routine can mask those errnos which don't qualify to +be an error for the application in that context, so then those +shall be reported at DEBUG level. + +The possible non-standard errnos are reported with their +POSIX name instead of their description to avoid confusion. +(Eg. for ENOENT we don't log "no such file or directory", +we log indeed literal "ENOENT".) + +Upstream on https://review.gluster.org/23974 +> Change-Id: I510158843e4b1d482bdc496c2e97b1860dc1ba93 +> updates: bz#1193929 +> Signed-off-by: Csaba Henk + +BUG: 1763208 +Change-Id: Ib1676bb334ed153ce74ae1c0413fc0e58fb388c7 +Signed-off-by: Csaba Henk +Reviewed-on: https://code.engineering.redhat.com/gerrit/189056 +Tested-by: RHGS Build Bot +Reviewed-by: Sunil Kumar Heggodu Gopala Acharya +--- + xlators/mount/fuse/src/fuse-bridge.c | 78 +++++++++++++++++++++++++++++++++--- + xlators/mount/fuse/src/fuse-bridge.h | 9 ++++- + 2 files changed, 80 insertions(+), 7 deletions(-) + +diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c +index ebe5c28..6e99053 100644 +--- a/xlators/mount/fuse/src/fuse-bridge.c ++++ b/xlators/mount/fuse/src/fuse-bridge.c +@@ -198,7 +198,7 @@ fusedump_setup_meta(struct iovec *iovs, char *dir, + + static int + check_and_dump_fuse_W(fuse_private_t *priv, struct iovec *iov_out, int count, +- ssize_t res) ++ ssize_t res, errnomask_t errnomask) + { + char w = 'W'; + struct iovec diov[4] = { +@@ -216,8 +216,59 @@ check_and_dump_fuse_W(fuse_private_t *priv, struct iovec *iov_out, int count, + struct fuse_out_header *fouh = NULL; + + if (res == -1) { +- gf_log_callingfn("glusterfs-fuse", GF_LOG_ERROR, +- "writing to fuse device failed: %s", strerror(errno)); ++ const char *errdesc = NULL; ++ gf_loglevel_t loglevel = GF_LOG_ERROR; ++ ++ /* If caller masked the errno, then it ++ * does not indicate an error at the application ++ * level, so we degrade the log severity to DEBUG. ++ */ ++ if (errnomask && errno < ERRNOMASK_MAX && ++ GET_ERRNO_MASK(errnomask, errno)) ++ loglevel = GF_LOG_DEBUG; ++ ++ switch (errno) { ++ /* The listed errnos are FUSE status indicators, ++ * not legit values according to POSIX (see write(3p)), ++ * so resolving them according to the standard ++ * POSIX interpretation would be misleading. ++ */ ++ case ENOENT: ++ errdesc = "ENOENT"; ++ break; ++ case ENOTDIR: ++ errdesc = "ENOTDIR"; ++ break; ++ case ENODEV: ++ errdesc = "ENODEV"; ++ break; ++ case EPERM: ++ errdesc = "EPERM"; ++ break; ++ case ENOMEM: ++ errdesc = "ENOMEM"; ++ break; ++ case ENOTCONN: ++ errdesc = "ENOTCONN"; ++ break; ++ case ECONNREFUSED: ++ errdesc = "ECONNREFUSED"; ++ break; ++ case EOVERFLOW: ++ errdesc = "EOVERFLOW"; ++ break; ++ case EBUSY: ++ errdesc = "EBUSY"; ++ break; ++ case ENOTEMPTY: ++ errdesc = "ENOTEMPTY"; ++ break; ++ default: ++ errdesc = strerror(errno); ++ } ++ ++ gf_log_callingfn("glusterfs-fuse", loglevel, ++ "writing to fuse device failed: %s", errdesc); + return errno; + } + +@@ -282,7 +333,7 @@ send_fuse_iov(xlator_t *this, fuse_in_header_t *finh, struct iovec *iov_out, + gf_log("glusterfs-fuse", GF_LOG_TRACE, "writev() result %d/%d %s", res, + fouh->len, res == -1 ? strerror(errno) : ""); + +- return check_and_dump_fuse_W(priv, iov_out, count, res); ++ return check_and_dump_fuse_W(priv, iov_out, count, res, NULL); + } + + static int +@@ -353,6 +404,15 @@ fuse_invalidate_entry(xlator_t *this, uint64_t fuse_ino) + fouh->unique = 0; + fouh->error = FUSE_NOTIFY_INVAL_ENTRY; + ++ if (ENOENT < ERRNOMASK_MAX) ++ MASK_ERRNO(node->errnomask, ENOENT); ++ if (ENOTDIR < ERRNOMASK_MAX) ++ MASK_ERRNO(node->errnomask, ENOTDIR); ++ if (EBUSY < ERRNOMASK_MAX) ++ MASK_ERRNO(node->errnomask, EBUSY); ++ if (ENOTEMPTY < ERRNOMASK_MAX) ++ MASK_ERRNO(node->errnomask, ENOTEMPTY); ++ + if (dentry->name) { + nlen = strlen(dentry->name); + fouh->len = sizeof(*fouh) + sizeof(*fnieo) + nlen + 1; +@@ -437,6 +497,9 @@ fuse_invalidate_inode(xlator_t *this, uint64_t fuse_ino) + fniio->off = 0; + fniio->len = -1; + ++ if (ENOENT < ERRNOMASK_MAX) ++ MASK_ERRNO(node->errnomask, ENOENT); ++ + fuse_log_eh(this, "Invalidated inode %" PRIu64 " (gfid: %s)", fuse_ino, + uuid_utoa(inode->gfid)); + gf_log("glusterfs-fuse", GF_LOG_TRACE, +@@ -482,6 +545,7 @@ fuse_timed_message_new(void) + /* should be NULL if not set */ + dmsg->fuse_message_body = NULL; + INIT_LIST_HEAD(&dmsg->next); ++ memset(dmsg->errnomask, 0, sizeof(dmsg->errnomask)); + + return dmsg; + } +@@ -680,6 +744,8 @@ fuse_interrupt(xlator_t *this, fuse_in_header_t *finh, void *msg, + dmsg->fuse_out_header.unique = finh->unique; + dmsg->fuse_out_header.len = sizeof(dmsg->fuse_out_header); + dmsg->fuse_out_header.error = -EAGAIN; ++ if (ENOENT < ERRNOMASK_MAX) ++ MASK_ERRNO(dmsg->errnomask, ENOENT); + timespec_now(&dmsg->scheduled_ts); + timespec_adjust_delta(&dmsg->scheduled_ts, + (struct timespec){0, 10000000}); +@@ -4848,7 +4914,7 @@ notify_kernel_loop(void *data) + iov_out.iov_base = node->inval_buf; + iov_out.iov_len = len; + rv = sys_writev(priv->fd, &iov_out, 1); +- check_and_dump_fuse_W(priv, &iov_out, 1, rv); ++ check_and_dump_fuse_W(priv, &iov_out, 1, rv, node->errnomask); + + GF_FREE(node); + +@@ -4940,7 +5006,7 @@ timed_response_loop(void *data) + iovs[1] = (struct iovec){dmsg->fuse_message_body, + len - sizeof(struct fuse_out_header)}; + rv = sys_writev(priv->fd, iovs, 2); +- check_and_dump_fuse_W(priv, iovs, 2, rv); ++ check_and_dump_fuse_W(priv, iovs, 2, rv, dmsg->errnomask); + + fuse_timed_message_free(dmsg); + +diff --git a/xlators/mount/fuse/src/fuse-bridge.h b/xlators/mount/fuse/src/fuse-bridge.h +index cf4479c..d2d462c 100644 +--- a/xlators/mount/fuse/src/fuse-bridge.h ++++ b/xlators/mount/fuse/src/fuse-bridge.h +@@ -195,14 +195,20 @@ struct fuse_private { + }; + typedef struct fuse_private fuse_private_t; + ++typedef uint64_t errnomask_t[2]; ++#define MASK_ERRNO(mask, n) ((mask)[(n) >> 6] |= ((uint64_t)1 << ((n)&63))) ++#define GET_ERRNO_MASK(mask, n) ((mask)[(n) >> 6] & ((uint64_t)1 << ((n)&63))) ++#define ERRNOMASK_MAX (64 * (sizeof(errnomask_t) / sizeof(uint64_t))) ++ + #define INVAL_BUF_SIZE \ + (sizeof(struct fuse_out_header) + \ + max(sizeof(struct fuse_notify_inval_inode_out), \ + sizeof(struct fuse_notify_inval_entry_out) + NAME_MAX + 1)) + + struct fuse_invalidate_node { +- char inval_buf[INVAL_BUF_SIZE]; ++ errnomask_t errnomask; + struct list_head next; ++ char inval_buf[INVAL_BUF_SIZE]; + }; + typedef struct fuse_invalidate_node fuse_invalidate_node_t; + +@@ -210,6 +216,7 @@ struct fuse_timed_message { + struct fuse_out_header fuse_out_header; + void *fuse_message_body; + struct timespec scheduled_ts; ++ errnomask_t errnomask; + struct list_head next; + }; + typedef struct fuse_timed_message fuse_timed_message_t; +-- +1.8.3.1 + diff --git a/glusterfs.spec b/glusterfs.spec index 7f5c77c..61a09ba 100644 --- a/glusterfs.spec +++ b/glusterfs.spec @@ -231,7 +231,7 @@ Release: 0.1%{?prereltag:.%{prereltag}}%{?dist} %else Name: glusterfs Version: 6.0 -Release: 25%{?dist} +Release: 26%{?dist} ExcludeArch: i686 %endif License: GPLv2 or LGPLv3+ @@ -653,6 +653,8 @@ Patch0341: 0341-socket-fix-error-handling.patch Patch0342: 0342-Revert-hooks-remove-selinux-hooks.patch Patch0343: 0343-extras-hooks-syntactical-errors-in-SELinux-hooks-sci.patch Patch0344: 0344-Revert-all-fixes-to-include-SELinux-hook-scripts.patch +Patch0345: 0345-read-ahead-io-cache-turn-off-by-default.patch +Patch0346: 0346-fuse-degrade-logging-of-write-failure-to-fuse-device.patch %description GlusterFS is a distributed file-system capable of scaling to several @@ -2380,6 +2382,9 @@ fi %endif %changelog +* Fri Jan 10 2020 Rinku Kothiya - 6.0-26 +- fixes bugs bz#1763208 bz#1788656 + * Mon Dec 23 2019 Rinku Kothiya - 6.0-25 - fixes bugs bz#1686800 bz#1763208 bz#1779696 bz#1781444 bz#1782162