diff --git a/0003-remove-duplicated-fuse_chan_put.patch b/0003-remove-duplicated-fuse_chan_put.patch new file mode 100644 index 0000000000000000000000000000000000000000..c9f58ddb571c0c708f93035afa0a99a80b6ad103 --- /dev/null +++ b/0003-remove-duplicated-fuse_chan_put.patch @@ -0,0 +1,22 @@ +From 402c8fff588120a7cf5922822904ce45f30612a8 Mon Sep 17 00:00:00 2001 +From: yangyun50 <149988609+yangyun50@users.noreply.github.com> +Date: Tue, 20 Feb 2024 18:52:39 +0800 +Subject: [PATCH] remove duplicated fuse_chan_put() (#893) + +--- + lib/fuse_lowlevel.c | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c +index d8c0cd149..86e49f74a 100644 +--- a/lib/fuse_lowlevel.c ++++ b/lib/fuse_lowlevel.c +@@ -1740,8 +1740,6 @@ static int find_interrupted(struct fuse_session *se, struct fuse_req *req) + pthread_mutex_lock(&se->lock); + curr->ctr--; + if (!curr->ctr) { +- fuse_chan_put(req->ch); +- req->ch = NULL; + destroy_req(curr); + } + diff --git a/0004-Fix-example-fix-notify_inval_inode.c.patch b/0004-Fix-example-fix-notify_inval_inode.c.patch new file mode 100644 index 0000000000000000000000000000000000000000..dd097fca7016599f90c4c283c3b53cdf06472686 --- /dev/null +++ b/0004-Fix-example-fix-notify_inval_inode.c.patch @@ -0,0 +1,90 @@ +From 9a823df6d91869960b733581dc71ccefcbe92cc3 Mon Sep 17 00:00:00 2001 +From: Bernd Schubert +Date: Wed, 20 Mar 2024 15:25:41 +0100 +Subject: [PATCH] Fix example/fix-notify_inval_inode.c (#908) + +Similar issue as fixed in commit +3c7ba570 "examples/notify_store_retrieve: Add a clean shutdown". +Basically a clean shutdown was missing, but even with clean +shutdown it does not work, as kernel side releases inodes before +sending FUSE_DESTROY - the intervaled thread then gets +-ENOENT. + +Co-authored-by: Bernd Schubert +--- + example/notify_inval_inode.c | 32 +++++++++++++++++++++++++++----- + 1 file changed, 27 insertions(+), 5 deletions(-) + +diff --git a/example/notify_inval_inode.c b/example/notify_inval_inode.c +index b3b50aab3..b1fb8f757 100644 +--- a/example/notify_inval_inode.c ++++ b/example/notify_inval_inode.c +@@ -71,6 +71,8 @@ + #include + #include + #include ++#include ++#include + + /* We can't actually tell the kernel that there is no + timeout, so we just send a big value */ +@@ -82,6 +84,7 @@ + static char file_contents[MAX_STR_LEN]; + static int lookup_cnt = 0; + static size_t file_size; ++static _Atomic bool is_stop = false; + + /* Command line parsing */ + struct options { +@@ -120,6 +123,13 @@ static int tfs_stat(fuse_ino_t ino, struct stat *stbuf) { + return 0; + } + ++static void tfs_destroy(void *userarg) ++{ ++ (void)userarg; ++ ++ is_stop = true; ++} ++ + static void tfs_lookup(fuse_req_t req, fuse_ino_t parent, + const char *name) { + struct fuse_entry_param e; +@@ -240,6 +250,7 @@ static void tfs_read(fuse_req_t req, fuse_ino_t ino, size_t size, + } + + static const struct fuse_lowlevel_ops tfs_oper = { ++ .destroy = tfs_destroy, + .lookup = tfs_lookup, + .getattr = tfs_getattr, + .readdir = tfs_readdir, +@@ -263,13 +274,24 @@ static void update_fs(void) { + static void* update_fs_loop(void *data) { + struct fuse_session *se = (struct fuse_session*) data; + +- while(1) { ++ while(!is_stop) { + update_fs(); + if (!options.no_notify && lookup_cnt) { +- /* Only send notification if the kernel +- is aware of the inode */ +- assert(fuse_lowlevel_notify_inval_inode +- (se, FILE_INO, 0, 0) == 0); ++ /* Only send notification if the kernel is aware of the inode */ ++ ++ /* Some errors (ENOENT, EBADFD, ENODEV) have to be accepted as the ++ * might come up during umount, when kernel side already releases ++ * all inodes, but does not send FUSE_DESTROY yet. ++ */ ++ int ret = ++ fuse_lowlevel_notify_inval_inode(se, FILE_INO, 0, 0); ++ if ((ret != 0 && !is_stop) && ++ ret != -ENOENT && ret != -EBADFD && ret != -ENODEV) { ++ fprintf(stderr, ++ "ERROR: fuse_lowlevel_notify_store() failed with %s (%d)\n", ++ strerror(-ret), -ret); ++ abort(); ++ } + } + sleep(options.update_interval); + } diff --git a/fuse3.spec b/fuse3.spec index dad4a8885cfd66037a03a6603d1f48d0521f2cb0..973439f8e16ada4bb7ac09b63d01d2fe3311b724 100644 --- a/fuse3.spec +++ b/fuse3.spec @@ -2,7 +2,7 @@ Name: fuse3 Version: %{fuse3ver} -Release: 1 +Release: 2 Summary: User space File System of fuse3 License: GPL+ and LGPLv2+ URL: http://fuse.sf.net @@ -11,6 +11,8 @@ Source1: fuse.conf Patch1: 0001-fix-chown-and-mknod-failed.patch Patch2: 0002-revert-fuse_daemonize-chdir-to-even-if-not-run.patch +Patch3: 0003-remove-duplicated-fuse_chan_put.patch +Patch4: 0004-Fix-example-fix-notify_inval_inode.c.patch BuildRequires: libselinux-devel, pkgconfig, systemd-udev, meson, fdupes BuildRequires: autoconf, automake, libtool, gettext-devel, ninja-build @@ -101,6 +103,10 @@ install -p -m 0644 %{SOURCE1} %{buildroot}%{_sysconfdir} %{_mandir}/man8/* %changelog +* Fri Jul 12 2024 zhangxingrong- -3.16.2-2 +- remove duplicated fuse_chan_put +- Fix example fix notify_inval_inode.c + * Tue Jan 30 2024 yangyun -3.16.2-1 - upgrade to 3.16.2 - fix some issues (see: https://github.com/libfuse/libfuse/releases)