From 4b358f9f48004ff550d14c693a3f3bc58e1a9e68 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Apr 28 2020 08:51:02 +0000 Subject: import fuse-overlayfs-0.7.2-5.module+el8.2.0+6060+9dbc027d --- diff --git a/SOURCES/fuse-overlayfs-1803495.patch b/SOURCES/fuse-overlayfs-1803495.patch deleted file mode 100644 index f7f7862..0000000 --- a/SOURCES/fuse-overlayfs-1803495.patch +++ /dev/null @@ -1,267 +0,0 @@ -From a68c9d75b592eba68026661877c7a0aed5dabf41 Mon Sep 17 00:00:00 2001 -From: Giuseppe Scrivano -Date: Sat, 15 Feb 2020 12:33:52 +0100 -Subject: [PATCH] main: force timeout 0 for ovl_link - -There is an issue on RHEL 8.1 where the nlink counter is always -incremented by one, no matter what is specified in e.attr.st_nlink. - -Always set timeout to 0 to force a new stat on the inode. - -Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1802907 -Closes: https://github.com/containers/fuse-overlayfs/issues/183 - -Signed-off-by: Giuseppe Scrivano ---- - main.c | 7 ++++++- - 1 file changed, 6 insertions(+), 1 deletion(-) - -diff --git a/main.c b/main.c -index b1bdfa4..7a6eae4 100644 ---- a/main.c -+++ b/main.c -@@ -3615,235 +3615,240 @@ ovl_setattr (fuse_req_t req, fuse_ino_t ino, struct stat *attr, int to_set, stru - ret = truncate (path, attr->st_size); - if (ret < 0) - { - fuse_reply_err (req, errno); - return; - } - } - - if (uid != -1 || gid != -1) - { - if (fd >= 0) - ret = fchown (fd, uid, gid); - else - ret = chown (path, uid, gid); - if (ret < 0) - { - fuse_reply_err (req, errno); - return; - } - } - - if (do_getattr (req, &e, node, fd, path) < 0) - { - fuse_reply_err (req, errno); - return; - } - - fuse_reply_attr (req, &e.attr, get_timeout (lo)); - } - - static int - direct_linkat (struct ovl_layer *l, const char *oldpath, const char *newpath, int flags) - { - return linkat (l->fd, oldpath, l->fd, newpath, 0); - } - - static void - ovl_link (fuse_req_t req, fuse_ino_t ino, fuse_ino_t newparent, const char *newname) - { - cleanup_lock int l = enter_big_lock (); - struct ovl_data *lo = ovl_data (req); - struct ovl_node *node, *newparentnode, *destnode; - cleanup_free char *path = NULL; - int ret; - struct fuse_entry_param e; - char wd_tmp_file_name[32]; - - if (UNLIKELY (ovl_debug (req))) - fprintf (stderr, "ovl_link(ino=%" PRIu64 "s, newparent=%" PRIu64 "s, newname=%s)\n", ino, newparent, newname); - - node = do_lookup_file (lo, ino, NULL); - if (node == NULL) - { - fuse_reply_err (req, ENOENT); - return; - } - - node = get_node_up (lo, node); - if (node == NULL) - { - fuse_reply_err (req, errno); - return; - } - - newparentnode = do_lookup_file (lo, newparent, NULL); - if (newparentnode == NULL) - { - fuse_reply_err (req, ENOENT); - return; - } - - destnode = do_lookup_file (lo, newparent, newname); - if (destnode && !destnode->whiteout) - { - fuse_reply_err (req, EEXIST); - return; - } - - newparentnode = get_node_up (lo, newparentnode); - if (newparentnode == NULL) - { - fuse_reply_err (req, errno); - return; - } - - if (delete_whiteout (lo, -1, newparentnode, newname) < 0) - { - fuse_reply_err (req, errno); - return; - } - - sprintf (wd_tmp_file_name, "%lu", get_next_wd_counter ()); - - ret = asprintf (&path, "%s/%s", newparentnode->path, newname); - if (ret < 0) - { - fuse_reply_err (req, errno); - return; - } - -+ /* -+ There is an issue on RHEL 8.1 where the nlink counter is always -+ incremented by one, no matter what is specified in e.attr.st_nlink. -+ In this function we always set timeout to 0 to force a new stat on the inode. -+ */ - ret = direct_linkat (get_upper_layer (lo), node->path, path, 0); - if (ret < 0) - { - fuse_reply_err (req, errno); - return; - } - - node = make_ovl_node (lo, path, get_upper_layer (lo), newname, node->tmp_ino, node->tmp_dev, false, newparentnode, lo->fast_ino_check); - if (node == NULL) - { - fuse_reply_err (req, ENOMEM); - return; - } - if (destnode && !destnode->whiteout) - node->last_layer = get_upper_layer (lo); - - node = insert_node (newparentnode, node, true); - if (node == NULL) - { - fuse_reply_err (req, ENOMEM); - return; - } - - memset (&e, 0, sizeof (e)); - - ret = rpl_stat (req, node, -1, NULL, NULL, &e.attr); - if (ret) - { - fuse_reply_err (req, errno); - return; - } - - e.ino = node_to_inode (node); - node->ino->lookups++; -- e.attr_timeout = get_timeout (lo); -+ e.attr_timeout = 0; - e.entry_timeout = get_timeout (lo); - fuse_reply_entry (req, &e); - } - - static int - direct_symlinkat (struct ovl_layer *l, const char *target, const char *linkpath, uid_t uid, gid_t gid) - { - struct ovl_data *lo = l->ovl_data; - char wd_tmp_file_name[32]; - int ret; - - sprintf (wd_tmp_file_name, "%lu", get_next_wd_counter ()); - - unlinkat (lo->workdir_fd, wd_tmp_file_name, 0); - ret = symlinkat (linkpath, lo->workdir_fd, wd_tmp_file_name); - if (ret < 0) - return ret; - - if (uid != lo->uid || gid != lo->gid) - { - ret = fchownat (lo->workdir_fd, wd_tmp_file_name, uid, gid, AT_SYMLINK_NOFOLLOW); - if (ret < 0) - { - unlinkat (lo->workdir_fd, wd_tmp_file_name, 0); - return ret; - } - } - - ret = renameat (lo->workdir_fd, wd_tmp_file_name, get_upper_layer (lo)->fd, target); - if (ret < 0) - { - unlinkat (lo->workdir_fd, wd_tmp_file_name, 0); - return ret; - } - - return 0; - } - - static void - ovl_symlink (fuse_req_t req, const char *link, fuse_ino_t parent, const char *name) - { - cleanup_lock int l = enter_big_lock (); - struct ovl_data *lo = ovl_data (req); - struct ovl_node *pnode, *node; - int ret; - struct fuse_entry_param e; - const struct fuse_ctx *ctx = fuse_req_ctx (req); - char wd_tmp_file_name[32]; - bool need_delete_whiteout = true; - cleanup_free char *path = NULL; - - if (UNLIKELY (ovl_debug (req))) - fprintf (stderr, "ovl_symlink(link=%s, ino=%" PRIu64 "s, name=%s)\n", link, parent, name); - - pnode = do_lookup_file (lo, parent, NULL); - if (pnode == NULL) - { - fuse_reply_err (req, ENOENT); - return; - } - - pnode = get_node_up (lo, pnode); - if (pnode == NULL) - { - fuse_reply_err (req, errno); - return; - } - - node = do_lookup_file (lo, parent, name); - if (node != NULL && !node->whiteout) - { - fuse_reply_err (req, EEXIST); - return; - } - - if (pnode->loaded && node == NULL) - need_delete_whiteout = false; - - ret = asprintf (&path, "%s/%s", pnode->path, name); - if (ret < 0) - { - fuse_reply_err (req, ENOMEM); - return; - } - - ret = direct_symlinkat (get_upper_layer (lo), path, link, get_uid (lo, ctx->uid), get_gid (lo, ctx->gid)); - if (ret < 0) - { - fuse_reply_err (req, ENOMEM); - return; - } - - if (need_delete_whiteout && delete_whiteout (lo, -1, pnode, name) < 0) - { - unlinkat (lo->workdir_fd, wd_tmp_file_name, 0); - fuse_reply_err (req, errno); - return; - } - - node = make_ovl_node (lo, path, get_upper_layer (lo), name, 0, 0, false, pnode, lo->fast_ino_check); --- -2.18.1 - diff --git a/SOURCES/fuse-overlayfs-1803496.patch b/SOURCES/fuse-overlayfs-1803496.patch new file mode 100644 index 0000000..c462f07 --- /dev/null +++ b/SOURCES/fuse-overlayfs-1803496.patch @@ -0,0 +1,48 @@ +From bd0246fa31ae596fed3a7f94917523798e2ab3c8 Mon Sep 17 00:00:00 2001 +From: Giuseppe Scrivano +Date: Sat, 15 Feb 2020 12:33:52 +0100 +Subject: [PATCH] main: force timeout 0 for ovl_link + +There is an issue on RHEL 8.1 where the nlink counter is always +incremented by one, no matter what is specified in e.attr.st_nlink. + +Always set timeout to 0 to force a new stat on the inode. + +Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1802907 +Closes: https://github.com/containers/fuse-overlayfs/issues/183 + +Signed-off-by: Giuseppe Scrivano +--- + main.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/main.c b/main.c +index 80c0f89..0e6dab3 100644 +--- a/main.c ++++ b/main.c +@@ -3714,6 +3714,12 @@ direct_linkat (struct ovl_layer *l, const char *oldpath, const char *newpath, in + static void + ovl_link (fuse_req_t req, fuse_ino_t ino, fuse_ino_t newparent, const char *newname) + { ++ /* ++ There is an issue on RHEL 8.1 where the nlink counter is always ++ incremented by one, no matter what is specified in e.attr.st_nlink. ++ In this function we always set timeout to 0 to force a new stat on the inode. ++ */ ++ + cleanup_lock int l = enter_big_lock (); + struct ovl_data *lo = ovl_data (req); + struct ovl_node *node, *newparentnode, *destnode; +@@ -3809,7 +3815,8 @@ ovl_link (fuse_req_t req, fuse_ino_t ino, fuse_ino_t newparent, const char *newn + + e.ino = node_to_inode (node); + node->ino->lookups++; +- e.attr_timeout = get_timeout (lo); ++ ++ e.attr_timeout = 0; + e.entry_timeout = get_timeout (lo); + fuse_reply_entry (req, &e); + } +-- +2.24.1 + diff --git a/SPECS/fuse-overlayfs.spec b/SPECS/fuse-overlayfs.spec index f8bae4b..3ec0750 100644 --- a/SPECS/fuse-overlayfs.spec +++ b/SPECS/fuse-overlayfs.spec @@ -12,7 +12,7 @@ ExclusiveArch: aarch64 %{arm} ppc64le s390x x86_64 Source0: %{git0}/archive/%{commit0}/%{name}-%{shortcommit0}.tar.gz # related bug: https://bugzilla.redhat.com/show_bug.cgi?id=1802907 # backported: https://patch-diff.githubusercontent.com/raw/containers/fuse-overlayfs/pull/184.patch -Patch0: fuse-overlayfs-1803495.patch +Patch0: fuse-overlayfs-1803496.patch # related bug: https://bugzilla.redhat.com/show_bug.cgi?id=1804849 # patch: https://bugzilla.redhat.com/attachment.cgi?id=1666385 Patch1: fuse-overlayfs-1804849.patch @@ -62,30 +62,35 @@ make DESTDIR=%{buildroot} install install-man %{_mandir}/man1/%{name}.1.gz %changelog -* Thu Mar 26 2020 Jindrich Novy - 0.7.2-5 -- be sure to work properly also with older rhel8 kernels, thanks to Giuseppe Scrivano -- Resolves: #1803495 - -* Tue Mar 24 2020 Jindrich Novy - 0.7.2-4 +* Thu Mar 19 2020 Jindrich Novy - 0.7.2-5 - latest iteration of segfault fix patch, thanks to Giuseppe Scrivano -- Resolves: #1803495 +- Resolves: #1805017 + +* Fri Mar 06 2020 Jindrich Novy - 0.7.2-4 +- replace "fuse-overlayfs segfault" patch with improved one + due to application to a different context +- Resolves: #1805017 * Thu Feb 20 2020 Jindrich Novy - 0.7.2-3 - fix "fuse-overlayfs segfault" -- Resolves: #1805016 +- Resolves: #1805017 * Mon Feb 17 2020 Jindrich Novy - 0.7.2-2 - fix "useradd and groupadd fail under rootless Buildah and podman" -- Resolves: #1803495 +- Resolves: #1803496 * Fri Nov 29 2019 Jindrich Novy - 0.7.2-1 - update to 0.7.2 -- Related: RHELPLAN-25138 +- Related: RHELPLAN-25139 + +* Fri Nov 29 2019 Jindrich Novy - 0.7.1-1 +- update to 0.7.1 +- Related: RHELPLAN-25139 * Mon Nov 18 2019 Jindrich Novy - 0.7-1 - update to 0.7 - apply patch to fix build on RHEL-8 -- Related: RHELPLAN-25138 +- Related: RHELPLAN-25139 * Sat Jun 15 2019 Lokesh Mandvekar - 0.4.1-1 - Resolves: #1720654 - rebase to v0.4.1