fuse rebuild

This commit is contained in:
Rmys
2023-01-15 13:34:22 +03:00
parent fb6b65062f
commit 57fc9d1084
7 changed files with 207 additions and 1 deletions
@@ -0,0 +1,28 @@
From: Tom Callaway <spot@fedoraproject.org>
Date: Wed, 26 Jun 2013 09:34:52 -0400
Subject: [PATCH] add fix for namespace conflict in fuse_kernel.h
https://bugzilla.redhat.com/show_bug.cgi?id=970768
diff --git a/include/fuse_kernel.h b/include/fuse_kernel.h
index c632b58..9e02fe3 100644
--- a/include/fuse_kernel.h
+++ b/include/fuse_kernel.h
@@ -88,12 +88,16 @@
#ifndef _LINUX_FUSE_H
#define _LINUX_FUSE_H
-#include <sys/types.h>
+#ifdef __linux__
+#include <linux/types.h>
+#else
+#include <stdint.h>
#define __u64 uint64_t
#define __s64 int64_t
#define __u32 uint32_t
#define __s32 int32_t
#define __u16 uint16_t
+#endif
/*
* Version negotiation:
@@ -0,0 +1,42 @@
From: Carlos Maiolino <cmaiolino-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Date: Thu, 20 Apr 2017 14:53:01 +0200
Subject: [PATCH] make buffer size match kernel max transfer size
Currently libfuse has a hardcoded buffer limit to 128kib, while fuse
kernel module has a limit up to 32 pages.
This patch changes buffer limit to match the current page size, instead
of assuming 4096 bytes pages, enabling architectures with bigger pages
to use larger buffers, improving performance.
Also, add a new macro (HEADER_SIZE) to specify the space needed to
accommodate the header, making it easier to understand why those extra
4096 bytes are needed
Signed-off-by: Carlos Maiolino <cmaiolino-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
diff --git a/lib/fuse_kern_chan.c b/lib/fuse_kern_chan.c
index 4a9beb8..640b91a 100644
--- a/lib/fuse_kern_chan.c
+++ b/lib/fuse_kern_chan.c
@@ -83,7 +83,10 @@ static void fuse_kern_chan_destroy(struct fuse_chan *ch)
close(fd);
}
-#define MIN_BUFSIZE 0x21000
+#define KERNEL_BUF_PAGES 32
+
+/* room needed in buffer to accommodate header */
+#define HEADER_SIZE 0x1000
struct fuse_chan *fuse_kern_chan_new(int fd)
{
@@ -92,7 +95,6 @@ struct fuse_chan *fuse_kern_chan_new(int fd)
.send = fuse_kern_chan_send,
.destroy = fuse_kern_chan_destroy,
};
- size_t bufsize = getpagesize() + 0x1000;
- bufsize = bufsize < MIN_BUFSIZE ? MIN_BUFSIZE : bufsize;
+ size_t bufsize = KERNEL_BUF_PAGES * getpagesize() + HEADER_SIZE;
return fuse_chan_new(&op, fd, bufsize, NULL);
}
@@ -0,0 +1,20 @@
From: Peter Lemenkov <lemenkov@gmail.com>
Date: Wed, 3 Apr 2019 12:23:56 +0300
Subject: [PATCH] Whitelist SMB2 found on some NAS devices
* https://bugzilla.redhat.com/1694552#c7
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
diff --git a/util/fusermount.c b/util/fusermount.c
index 4b799d9..ef9d1ed 100644
--- a/util/fusermount.c
+++ b/util/fusermount.c
@@ -1046,6 +1046,7 @@ static int check_perm(const char **mntp, struct stat *stbuf, int *mountpoint_fd)
0x5346544E /* NTFS_SB_MAGIC */,
0x794C7630 /* OVERLAYFS_SUPER_MAGIC */,
0x52654973 /* REISERFS_SUPER_MAGIC */,
+ 0xFE534D42 /* SMB2_SUPER_MAGIC */,
0x73717368 /* SQUASHFS_MAGIC */,
0x01021994 /* TMPFS_MAGIC */,
0x24051905 /* UBIFS_SUPER_MAGIC */,
@@ -0,0 +1,31 @@
From: tenzap <46226844+tenzap@users.noreply.github.com>
Date: Sun, 15 Sep 2019 17:57:08 +0200
Subject: [PATCH] Whitelist UFSD (backport to 2.9 branch) (#452)
diff --git a/ChangeLog b/ChangeLog
index 13a369f..5574f20 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Unreleased Changes
+==================
+
+* Added UFSD to whitelist (so users can now mount FUSE filesystems
+ on mountpoints within UFSD filesystems).
+
FUSE 2.9.9 (2019-01-04)
=======================
diff --git a/util/fusermount.c b/util/fusermount.c
index ef9d1ed..63a69dc 100644
--- a/util/fusermount.c
+++ b/util/fusermount.c
@@ -1050,6 +1050,7 @@ static int check_perm(const char **mntp, struct stat *stbuf, int *mountpoint_fd)
0x73717368 /* SQUASHFS_MAGIC */,
0x01021994 /* TMPFS_MAGIC */,
0x24051905 /* UBIFS_SUPER_MAGIC */,
+ 0x736675005346544e /* UFSD */,
0x58465342 /* XFS_SB_MAGIC */,
0x2FC12FC1 /* ZFS_SUPER_MAGIC */,
};
@@ -0,0 +1,18 @@
From: Andrew Gaul <gaul@google.com>
Date: Mon, 14 Dec 2020 19:16:05 +0900
Subject: [PATCH] Correct errno comparison (#571)
diff --git a/lib/fuse.c b/lib/fuse.c
index ca1709c..896aa24 100644
--- a/lib/fuse.c
+++ b/lib/fuse.c
@@ -4348,7 +4348,7 @@ static int fuse_session_loop_remember(struct fuse *f)
res = poll(&fds, 1, timeout * 1000);
if (res == -1) {
- if (errno == -EINTR)
+ if (errno == EINTR)
continue;
else
break;
@@ -0,0 +1,55 @@
From: Sam James <sam@gentoo.org>
Date: Sat, 24 Jul 2021 22:02:45 +0100
Subject: [PATCH] util/ulockmgr_server.c: conditionally define closefrom (fix
glibc-2.34+)
closefrom(3) has joined us in glibc-land from *BSD and Solaris. Since
it's available in glibc 2.34+, we want to detect it and only define our
fallback if the libc doesn't provide it.
Bug: https://bugs.gentoo.org/803923
Signed-off-by: Sam James <sam@gentoo.org>
diff --git a/configure.ac b/configure.ac
index 9946a0e..a2d481a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -55,6 +55,7 @@ fi
AC_CHECK_FUNCS([fork setxattr fdatasync splice vmsplice utimensat])
AC_CHECK_FUNCS([posix_fallocate])
+AC_CHECK_FUNCS([closefrom])
AC_CHECK_MEMBERS([struct stat.st_atim])
AC_CHECK_MEMBERS([struct stat.st_atimespec])
diff --git a/util/ulockmgr_server.c b/util/ulockmgr_server.c
index 273c7d9..a04dac5 100644
--- a/util/ulockmgr_server.c
+++ b/util/ulockmgr_server.c
@@ -22,6 +22,10 @@
#include <sys/socket.h>
#include <sys/wait.h>
+#ifdef HAVE_CONFIG_H
+ #include "config.h"
+#endif
+
struct message {
unsigned intr : 1;
unsigned nofd : 1;
@@ -124,6 +128,7 @@ static int receive_message(int sock, void *buf, size_t buflen, int *fdp,
return res;
}
+#if !defined(HAVE_CLOSEFROM)
static int closefrom(int minfd)
{
DIR *dir = opendir("/proc/self/fd");
@@ -141,6 +146,7 @@ static int closefrom(int minfd)
}
return 0;
}
+#endif
static void send_reply(int cfd, struct message *msg)
{
+13 -1
View File
@@ -17,7 +17,12 @@
<Dependency>gettext-devel</Dependency>
</BuildDependencies>
<Patches>
<!--Patch>skip_umount_test.patch</Patch-->
<Patch level="1">fedora/fuse2-0002-add-fix-for-namespace-conflict-in-fuse_kernel.h.patch</Patch>
<Patch level="1">fedora/fuse2-0003-make-buffer-size-match-kernel-max-transfer-size.patch</Patch>
<Patch level="1">fedora/fuse2-0004-Whitelist-SMB2-found-on-some-NAS-devices.patch</Patch>
<Patch level="1">fedora/fuse2-0005-Whitelist-UFSD-backport-to-2.9-branch-452.patch</Patch>
<Patch level="1">fedora/fuse2-0006-Correct-errno-comparison-571.patch</Patch>
<Patch level="1">fedora/fuse2-0007-util-ulockmgr_server.c-conditionally-define-closefro.patch</Patch>
</Patches>
</Source>
@@ -50,6 +55,13 @@
</Package>
<History>
<Update release="9">
<Date>2023-01-13</Date>
<Version>2.9.9</Version>
<Comment>Rebuild.</Comment>
<Name>Mustafa Cinasal</Name>
<Email>muscnsl@gmail.com</Email>
</Update>
<Update release="8">
<Date>2021-07-17</Date>
<Version>2.9.9</Version>