Advertise support of FUSE_PARALLEL_DIROPS to kernel

This commit is contained in:
Pavel Reichl 2024-02-07 19:27:00 +01:00 committed by root
parent c619b1c175
commit 03d148655b
4 changed files with 75 additions and 1 deletions

1
.fuse3.metadata Normal file
View File

@ -0,0 +1 @@
97e7affc42039ea8a98adc606278fb0593462c7e fuse-3.10.2.tar.gz

View File

@ -0,0 +1,42 @@
From 2c736f516f28dfb5c58aff345c668a5ea6386295 Mon Sep 17 00:00:00 2001
From: Miklos Szeredi <mszeredi@redhat.com>
Date: Wed, 10 Jan 2024 10:15:43 +0100
Subject: [PATCH] Don't set FUSE_CAP_PARALLEL_DIROPS by default
Allowing parallel dir operations could result in a crash in a filesystem
implementation that is not prepared for this.
To be safe keep this flag off by default (this is not a regression, since
there was no public release where this flag wasn't ignored).
If the filesystem wants better performance, then it should set this flag
explicitly.
Fixes: c9905341ea34 ("Pass FUSE_PARALLEL_DIROPS to kernel (#861)")
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
---
include/fuse_common.h | 2 --
lib/fuse_lowlevel.c | 1 -
2 files changed, 3 deletions(-)
--- a/include/fuse_common.h
+++ b/include/fuse_common.h
@@ -313,8 +313,6 @@ struct fuse_loop_config {
* is unset, the FUSE kernel module will ensure that lookup() and
* readdir() requests are never issued concurrently for the same
* directory.
- *
- * This feature is enabled by default when supported by the kernel.
*/
#define FUSE_CAP_PARALLEL_DIROPS (1 << 18)
--- a/lib/fuse_lowlevel.c
+++ b/lib/fuse_lowlevel.c
@@ -2009,7 +2009,6 @@ void do_init(fuse_req_t req, fuse_ino_t
if ((cond) && (se->conn.capable & (cap))) \
se->conn.want |= (cap)
LL_SET_DEFAULT(1, FUSE_CAP_ASYNC_READ);
- LL_SET_DEFAULT(1, FUSE_CAP_PARALLEL_DIROPS);
LL_SET_DEFAULT(1, FUSE_CAP_AUTO_INVAL_DATA);
LL_SET_DEFAULT(1, FUSE_CAP_HANDLE_KILLPRIV);
LL_SET_DEFAULT(1, FUSE_CAP_ASYNC_DIO);

View File

@ -0,0 +1,23 @@
From c9905341ea34ff9acbc11b3c53ba8bcea35eeed8 Mon Sep 17 00:00:00 2001
From: fdinoff <fdinoff@google.com>
Date: Thu, 16 Nov 2023 06:23:20 -0500
Subject: [PATCH] Pass FUSE_PARALLEL_DIROPS to kernel (#861)
This tells the kernel that parallel lookup/readdir operations are
supported. This is enabled by default but was not passed to the kernel
so you always get the synchronized version.
---
lib/fuse_lowlevel.c | 2 ++
1 file changed, 2 insertions(+)
--- a/lib/fuse_lowlevel.c
+++ b/lib/fuse_lowlevel.c
@@ -2093,6 +2093,8 @@ void do_init(fuse_req_t req, fuse_ino_t
outargflags |= FUSE_ASYNC_DIO;
if (se->conn.want & FUSE_CAP_WRITEBACK_CACHE)
outargflags |= FUSE_WRITEBACK_CACHE;
+ if (se->conn.want & FUSE_CAP_PARALLEL_DIROPS)
+ outargflags |= FUSE_PARALLEL_DIROPS;
if (se->conn.want & FUSE_CAP_POSIX_ACL)
outargflags |= FUSE_POSIX_ACL;
if (se->conn.want & FUSE_CAP_CACHE_SYMLINKS)

View File

@ -1,6 +1,6 @@
Name: fuse3
Version: 3.10.2
Release: 7%{?dist}
Release: 8%{?dist}
Summary: File System in Userspace (FUSE) v3 utilities
License: GPL+
URL: http://fuse.sf.net
@ -13,6 +13,8 @@ Patch3: fuse-3.13.0-Initial-patch-provided-by-Miklos-Szeredi-mszeredi-re.patch
Patch4: fuse-3.13.0-adding-comments-and-capability-discovery-enum-for-fl.patch
Patch5: rhel-only-bz2188182-libfuse-add-feature-flag-for-expire-only.patch
Patch6: fuse-3.16.1-Make-expire-only-function-fail-if-no-kernel-support-.patch
Patch7: fuse-3.17.0-Pass-FUSE_PARALLEL_DIROPS-to-kernel-861.patch
Patch8: fuse-3.17.0-Don-t-set-FUSE_CAP_PARALLEL_DIROPS-by-default.patch
BuildRequires: which
%if ! 0%{?el6}
@ -81,6 +83,8 @@ Common files for FUSE v2 and FUSE v3.
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%build
export LC_ALL=en_US.UTF-8
@ -170,6 +174,10 @@ rm -f %{buildroot}/usr/lib/udev/rules.d/99-fuse3.rules
%endif
%changelog
* Wed Feb 07 2024 Pavel Reichl <preichl@redhat.com> - 3.10.2-8
- Advertise support of FUSE_PARALLEL_DIROPS to kernel
- Related: RHEL-24721
* Tue Jan 30 2024 Pavel Reichl <preichl@redhat.com> - 3.10.2-7
- Synchronize expire-only API with upstream.
- Related: RHEL-23414