🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: muc.lists.freebsd.bugs
Article #28

[Bug 299239] inotify_add_watch(2) fails with EBADF on fusefs subdirectories

#28
From: 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
Technical Details
Message-ID: <bug-299239-227@https.bugs.freebsd.org/bugzilla/>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!2.eu.feeder.erje.net!3.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.karotte.org!news.space.net!news.muc.de!.POSTED.news.muc.de!not-for-mail

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!2.eu.feeder.erje.net!3.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.karotte.org!news.space.net!news.muc.de!.POSTED.news.muc.de!not-for-mail
From: bugzilla-noreply@freebsd.org
Newsgroups: muc.lists.freebsd.bugs
Subject: [Bug 299239] inotify_add_watch(2) fails with EBADF on fusefs
 subdirectories
Date: Fri, 09 Oct 2026 01:57:15 +0000
Organization: Newsgate at muc.de e.V.
Sender: owner-freebsd-bugs@FreeBSD.org
Approved: news-admin@muc.de
Distribution: world
Message-ID: <bug-299239-227@https.bugs.freebsd.org/bugzilla/>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Injection-Info: news.muc.de; posting-host="news.muc.de:193.149.48.2";
	logging-data="52570"; mail-complaints-to="news-admin@muc.de"
X-Original-To: bugs@mlmmj.nyi.freebsd.org
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim;
	t=1791511036;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding;
	bh=/j2CurTbEj2nBUyQvhfs7J0S1te/whzq+rxoSdhyenQ=;
	b=lcwMRNSD73a1UoOWB3yylcvXf9UoAd2NUpQzNZKAmr/GBFdGsqAYZRV7klI2aJzgXMxW35
	br5KI2fnHLtztdJRohz3tEV9A4OpUv3+2gjGDbz/8xSyw2zusLlQlPVNFt7trhgoeoFvt3
	PPcKOyevunsDu1QCE7PA0liVi0wEyAc+hLPgefbidChXng7abynw2IqJ3iibPLmkBHuq/n
	Xoj2c5R/t73beJp4OeqOz9ih2ksVbdY/zBePypfI9GI5An33to+8LINQflVTjYTF8v1Akw
	9Hi9fcLZC3uyLhheJQbMdTuGyoTQLT7n9mvLaIikZD5EXHJfUPTG3dA4cvOC/w==
X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f
Auto-Submitted: auto-generated
Precedence: list
X-Newsgate-Id: f02c70b8849f+
X-No-Archive: Yes