[Bug 299241] inotify watches make unmount(2) fail with EBUSY

From: <bugzilla-noreply_at_freebsd.org>
Date: Fri, 09 Oct 2026 02:51:09 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299241

            Bug ID: 299241
           Summary: inotify watches make unmount(2) fail with EBUSY
           Product: Base System
           Version: 15.1-RELEASE
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: sam@sheridan.co.uk
 Attachment #275512 text/plain
         mime type:

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

On 15.1-RELEASE-p4, an inotify watch on any directory of a file system
makes umount fail with EBUSY until the watcher exits. In practice, Thunar
showing a USB stick stops it from being ejected.

Reproduce with the attached inw.c:
  mount -t tmpfs tmpfs /mnt; mkdir /mnt/sub
  ./inw /mnt/sub &
  umount /mnt        # Device busy

See Also: 299239

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