🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: muc.lists.freebsd.bugs
2 messages
2 total messages Started by bugzilla-noreply Fri, 09 Oct 2026 01:57
[Bug 299239] inotify_add_watch(2) fails with EBADF on fusefs subdirectories
#28
Author: bugzilla-noreply
Date: Fri, 09 Oct 2026 01:57
49 lines
3782 bytes
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299239

            Bug ID: 299239
           Summary: inotify_add_watch(2) fails with EBADF on fusefs
                    subdirectories
           Product: Base System
           Version: 15.1-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: sam@sheridan.co.uk
 Attachment #275510 text/plain
         mime type:

Created attachment 275510
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=275510&action=edit
inotify test: watches a directory and prints events

On 15.1-RELEASE-p4 amd64, inotify_add_watch() on a directory inside a fusefs
mount fails with EBADF unless some process has that directory open. File
managers (Thunar, via GLib) never see changes on exFAT/NTFS drives.

vn_inotify_add_watch() scans the directory with vn_dir_next_dirent() without
a VOP_OPEN, and fuse_vnop_readdir() returns EBADF when there is no open
directory handle (it only opens one implicitly for MNT_EXPORTED mounts).
Same code in main. The mount's root works because fuse_vnop_close() keeps
directory handles until VOP_INACTIVE, which the root never reaches.

To reproduce with the attached inw.c and fusefs-exfat:
  mount.exfat-fuse /dev/da1s1 /mnt; mkdir /mnt/sub
  ./inw /mnt/sub                                # Bad file descriptor
  sh -c 'exec 3</mnt/sub; sleep 30' & ./inw /mnt/sub   # works

Same pattern as bug 278135 (a fusefs operation on a vnode with no open handle).

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

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de
[Bug 299239] inotify_add_watch(2) fails with EBADF on fusefs subdirectories
#32
Author: bugzilla-noreply
Date: Fri, 09 Oct 2026 14:30
29 lines
3265 bytes
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299239

Mark Johnston <markj@FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|New                         |Open
                 CC|                            |markj@FreeBSD.org
           Assignee|bugs@FreeBSD.org            |markj@FreeBSD.org

--- Comment #1 from Mark Johnston <markj@FreeBSD.org> ---
Is there an easy way to create a exfat filesystem that I can use for testing?

I think this particular problem should be straightforward to fix (we can
implement VOP_INOTIFY_ADD_WATCH in fusefs and have it open the directory), but
there is the added problem that fusefs filesystems don't populate the name
cache, which inotify relies upon for certain file events, so I guess we will
need to fall back to a readdir in that case, same as in vop_stdvptocnp().

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

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads