[Bug 258056] sys/fs/fuse: commit 7b8622fa22 breaks net/rclone mount

From: <bugzilla-noreply_at_freebsd.org>
Date: Thu, 26 Aug 2021 10:15:29 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=258056

            Bug ID: 258056
           Summary: sys/fs/fuse: commit 7b8622fa22 breaks net/rclone mount
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: kwhite.uottawa@gmail.com
                CC: asomers@FreeBSD.org

After this commit, rclone mount no longer works.

# rclone mount --http-url https://www.freebsd.org/ :http: /mnt --read-only
2021/07/27 07:06:59 Fatal error: failed to umount FUSE fs: resource temporarily
unavailable

==================
7b8622fa220b9c08041102f638f848c48e022644 is the first bad commit
commit 7b8622fa220b9c08041102f638f848c48e022644
Author: Alan Somers <asomers@FreeBSD.org>
Date: Tue Jun 15 17:17:28 2021 -0600

fusefs: support EVFILT_WRITE on /dev/fuse

/dev/fuse is always ready for writing, so it's kind of dumb to poll it.
But some applications do it anyway. Better to return ready than EINVAL.

MFC after: 2 weeks
Reviewed by: emaste, pfg
Differential Revision: https://reviews.freebsd.org/D30784

sys/fs/fuse/fuse_device.c | 22 +++++++++++++++++++++-
tests/sys/fs/fusefs/mockfs.cc | 20 +++++++++++++++++---
2 files changed, 38 insertions(+), 4 deletions(-)
=====================

Restoring the previous EINVAL fixes the problem for me.
========
diff --git a/sys/fs/fuse/fuse_device.c b/sys/fs/fuse/fuse_device.c
index f8807d6d1c2..62b71ae1514 100644
--- a/sys/fs/fuse/fuse_device.c
+++ b/sys/fs/fuse/fuse_device.c
@@ -193,7 +193,7 @@ fuse_device_filter(struct cdev *dev, struct knote *kn)
                error = 0;
        } else if (error == 0 && kn->kn_filter == EVFILT_WRITE) {
                kn->kn_fop = &fuse_device_wfiltops;
-               error = 0;
+               error = EINVAL;
        } else if (error == 0) {
                error = EINVAL;
                kn->kn_data = error;
========

# rclone --version
rclone v1.55.1-DEV
- os/type: freebsd
- os/arch: amd64
- go/version: go1.16.6
- go/linking: dynamic
- go/tags: none

...keith

-- 
You are receiving this mail because:
You are the assignee for the bug.