[Bug 256936] Buggy filesystem detected - message wrongly triggered by FUSE filesystems

From: <bugzilla-noreply_at_freebsd.org>
Date: Fri, 02 Jul 2021 11:55:27 UTC

            Bug ID: 256936
           Summary: Buggy filesystem detected - message wrongly triggered
                    by FUSE filesystems
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: chogata@moosefs.pro

Since FreeBSD 12.2(? or 12.1?) and still on FreeBSD 13.0 machines running
MooseFS occasionally show a message:

"fuse_internal_do_getattr: cache incoherent on [PATH]! Buggy FUSE server

I tried to narrow down the issue. This script:

#! /usr/bin/env bash
set -e

while true
        size=$(((2097152 + $RANDOM) % 1024))
        dd if=/dev/urandom of=somefile bs=1k count=$size

ran on 2 different mount points of the same MooseFS directory (so 2 processes
in 2 different mount points modify the same file) triggers it constantly.

You can get the same result if you mount 2 instances of SSHfs and run this
script on both.

I suspect this has to do with file length changing during the write operation.
I don't know what SSHfs does, but MooseFS sends invalidate messages every time
an open file's length changes. I checked the operation log and they are sent
almost constantly along the write operations when the above scripts are run on
2 mount points. However invalidates are not obligatory and even when sent, a
race between invalidate and getattr can still occur. And this is not
filesystem's fault. Kernel should trust the information it gets from getattr,
especially on a network filesystem. This is not "buggy" behaviour :)

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