[Bug 259071] Read reports wrong number of bytes on a network filesystem.

From: <bugzilla-noreply_at_freebsd.org>
Date: Mon, 11 Oct 2021 12:44:27 UTC

            Bug ID: 259071
           Summary: Read reports wrong number of bytes on a network
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: chogata@moosefs.pro
 Attachment #228584 text/plain
         mime type:

Created attachment 228584
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=228584&action=edit
Simple file ops program

In connection with bug #256937, bug #256936 and reports from MooseFS users
(that complain, that with large source trees "git clone" operation often fails
on MooseFS, when client/mount is on FreeBSD) we developed a program, that shows
a basic problem with FreeBSD kernel. 
It's a simple program, that creates 2 processes. The main process continuously
performs 3 operations on a file, at random: read, write or ftruncate. The child
process performs stat operation on the same file.

If the program is run on a local filesystem on FreeBSD, it works. If it is run
on any fusefs (SSHfs, MooseFS) or even on NFS, at some point (usually under 1
minute) the read operation will return wrong number of bytes. No "networking"
necessary - all modifications and reads from file happen on one mountpoint.

The same program will run on Linux on any kind of fs (local, nfs, fusefs) with
no problems.

I'm attaching the program. The steps to repeat are simple: install FreeBSD (13
or 14, but with patch from bug #256937, otherwise you will experience kernel
panics), compile the program and run it on selected filesystems, wait for

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