From 98548c3f236689c285b9e9934ea58ea2e71f2bd5 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Aug 01 2017 03:52:50 +0000 Subject: import fuse-2.9.2-8.el7 --- diff --git a/SOURCES/buffer_size.patch b/SOURCES/buffer_size.patch new file mode 100644 index 0000000..b911282 --- /dev/null +++ b/SOURCES/buffer_size.patch @@ -0,0 +1,54 @@ +From a83b3ec1d7ce2d656a4c476d65486371d1a659b2 Mon Sep 17 00:00:00 2001 +From: Carlos Maiolino +Date: Tue, 2 May 2017 12:46:10 +0200 +Subject: [PATCH] From 4f8f034a8969a48f210bf00be78a67cfb6964c72 Mon Sep 17 + 00:00:00 2001 From: Carlos Maiolino + 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 +Signed-off-by: Carlos Maiolino +--- + lib/fuse_kern_chan.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/lib/fuse_kern_chan.c b/lib/fuse_kern_chan.c +index 5f77bbf..4cc9b73 100644 +--- a/lib/fuse_kern_chan.c ++++ b/lib/fuse_kern_chan.c +@@ -80,7 +80,10 @@ static void fuse_kern_chan_destroy(struct fuse_chan *ch) + close(fuse_chan_fd(ch)); + } + +-#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) + { +@@ -89,7 +92,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); + } +-- +2.9.3 + diff --git a/SPECS/fuse.spec b/SPECS/fuse.spec index 3d34b02..6d9dcf1 100644 --- a/SPECS/fuse.spec +++ b/SPECS/fuse.spec @@ -1,6 +1,6 @@ Name: fuse Version: 2.9.2 -Release: 7%{?dist} +Release: 8%{?dist} Summary: File System in Userspace (FUSE) utilities Group: System Environment/Base @@ -11,6 +11,7 @@ Source1: %{name}.conf Patch1: fuse-0001-More-parentheses.patch Patch2: fuse-aarch64.patch +Patch3: buffer_size.patch Requires: which Conflicts: filesystem < 3 BuildRequires: libselinux-devel @@ -53,6 +54,7 @@ pgk-config) to develop FUSE based applications/filesystems. sed -i 's|mknod|echo Disabled: mknod |g' util/Makefile.in %patch1 -p1 -b .add_parentheses %patch2 -p1 -b .aarch64 +%patch3 -p1 -b .buffer_size %build # Can't pass --disable-static here, or else the utils don't build @@ -104,6 +106,9 @@ rm -f %{buildroot}%{_sysconfdir}/udev/rules.d/99-fuse.rules %{_includedir}/fuse %changelog +* Tue May 02 2017 Carlos Maiolino - 2.9.2-8 +- Make buffer size match kernel max transfer size + * Thu May 19 2016 Carlos Maiolino - 2.9.2-7 - Enable PIE and RELRO check