- backport buffer-size patch to fuse2

This commit is contained in:
Dan Horák 2018-11-09 12:03:33 +01:00
parent e3fb4d18e7
commit 27912d64ea
2 changed files with 32 additions and 1 deletions

View File

@ -0,0 +1,24 @@
diff -up libfuse-fuse-2.9.7/lib/fuse_kern_chan.c.buffer_size libfuse-fuse-2.9.7/lib/fuse_kern_chan.c
--- libfuse-fuse-2.9.7/lib/fuse_kern_chan.c.buffer_size 2016-06-20 21:55:12.000000000 +0200
+++ libfuse-fuse-2.9.7/lib/fuse_kern_chan.c 2018-11-09 11:58:18.942124327 +0100
@@ -83,7 +83,10 @@ static void fuse_kern_chan_destroy(struc
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
.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);
}

View File

@ -4,7 +4,7 @@
Name: fuse Name: fuse
Version: %{fuse2ver} Version: %{fuse2ver}
Release: 14%{?dist} Release: 15%{?dist}
Summary: File System in Userspace (FUSE) v2 utilities Summary: File System in Userspace (FUSE) v2 utilities
License: GPL+ License: GPL+
URL: http://fuse.sf.net URL: http://fuse.sf.net
@ -19,6 +19,9 @@ Patch2: fuse-0001-More-parentheses.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=970768 # https://bugzilla.redhat.com/show_bug.cgi?id=970768
Patch3: fuse-2.9.2-namespace-conflict-fix.patch Patch3: fuse-2.9.2-namespace-conflict-fix.patch
Patch4: fuse-3.2.1-no-dev.patch Patch4: fuse-3.2.1-no-dev.patch
# https://github.com/libfuse/libfuse/commit/4f8f034a8969a48f210bf00be78a67cfb6964c72
# backported for fuse2
Patch5: fuse-2.9.7-buffer-size.patch
Requires: which Requires: which
Conflicts: filesystem < 3 Conflicts: filesystem < 3
@ -116,6 +119,7 @@ pushd lib%{name}-%{name}-%{fuse2ver}
sed -i 's|mknod|echo Disabled: mknod |g' util/Makefile.in sed -i 's|mknod|echo Disabled: mknod |g' util/Makefile.in
%patch2 -p1 -b .add_parentheses %patch2 -p1 -b .add_parentheses
%patch3 -p1 -b .conflictfix %patch3 -p1 -b .conflictfix
%patch5 -p1 -b .buffer_size
popd popd
%build %build
@ -231,6 +235,9 @@ rm -f %{buildroot}/usr/lib/udev/rules.d/99-fuse3.rules
%{_includedir}/fuse3/ %{_includedir}/fuse3/
%changelog %changelog
* Fri Nov 09 2018 Dan Horák <dan[at]danny.cz> - 2.9.7-15
- backport buffer-size patch to fuse2
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.7-14 * Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.7-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild