https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=247276

            Bug ID: 247276
           Summary: [fusefs] lockup when using mmap w/ direct_io
           Product: Base System
           Version: 12.1-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: kern
          Assignee: [email protected]
          Reporter: [email protected]
 Attachment #215581 text/plain
         mime type:

Created attachment 215581
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=215581&action=edit
example mmap usage

I'm the author of the FUSE based filesystem mergerfs. A user recently reported
that after updating to 12.1 some client software to mergerfs was locking up.
rtorrent in particular. 

rtorrent uses mmap. Linux's FUSE implementation is unable to handle mmap when
direct_io is enabled so I recommend to users not enable direct_io who need any
software leveraging mmap. The user hadn't read the docs and was using direct_io
on FreeBSD. It appears that mmap does work on FreeBSD's FUSE implementation
when direct_io is used so he had no issues.

Once updated his setup started blocking and the apps became unkillable (waiting
on IO). I wrote a simple mmap example to read and write to a shared mapped file
and could reproduce the issue.

When direct_io is off everything works fine. If I enable direct_io I will see
read requests come into the mergerfs server and so long as I only read from the
mapped memory it works fine. When writing however as soon as it needs to flush
it seems to lock up. I don't see any write commands come in, the client app
blocks and is unkillable, other calls into the filesystem seem to work briefly
and then block. A stack trace of mergerfs seems to indicate that it is working
as normal and could take requests. If mergerfs is killed none of the clients
receive an error from the syscalls they are blocked on.

I've been able to reproduce this with sshfs by simply adding `direct_io` to the
mount options.

Attached is an example that triggers it.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "[email protected]"

Reply via email to