Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 7 Sep 2025 11:21:54 -0600
From:      Alan Somers <asomers@freebsd.org>
To:        Konstantin Belousov <kostikbel@gmail.com>
Cc:        obiwac <obiwac@freebsd.org>, freebsd-current@freebsd.org, freebsd-fs@freebsd.org
Subject:   Re: Fuse issue with attr caching expecting write lock
Message-ID:  <CAOtMX2gr2uFBHbvHDgcwZiihYZ5tCNKxmz6=5bY2F=vfu7O5Ug@mail.gmail.com>
In-Reply-To: <aLorc9rz87dibsQL@kib.kiev.ua>
References:  <CAN8-kNV6-H_YtmT2MeYkYOPcgcWrpe2K9jxqdb%2BjRzOJuk=-dA@mail.gmail.com> <aLorc9rz87dibsQL@kib.kiev.ua>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
On Thu, Sep 4, 2025 at 6:15 PM Konstantin Belousov <kostikbel@gmail.com>
wrote:

> On Fri, Sep 05, 2025 at 01:36:39AM +0200, obiwac wrote:
> > Hi!
> >
> > When trying to access a large file with sshfs (on fuse), I get a
> > kernel panic because fuse_internal_cache_attrs is asserting a write
> > lock when it is sometimes being called from fuse_internal_do_getattr,
> > which only asserts a read lock.
> >
> > To me (i.e. someone who has never touched VFS or fuse code) this code
> > looks wrong, and fuse_internal_do_getattr should be acquiring a write
> > lock around its call to fuse_internal_cache_attrs, but clearly it has
> > been working just fine for a while now as this code hasn't changed
> > super recently so I could be missing something.
> It is only the assertions that were enabled recently.
>
> Mark merged DEBUG_VFS_LOCKS option into INVARIANTS.
>

 I'm not surprised to see bugs like this one, for the reason Kib stated.  I
suspect that there are many more, because DEBUG_VFS_LOCKS was historically
rarely used.  If you can come up with an easy reproduction case, please
open a ticket on bugzilla and CC me.  And BTW, my FreeBSD user name is
"asomers", not "alan.somers".

[-- Attachment #2 --]
<div dir="ltr"><div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Sep 4, 2025 at 6:15 PM Konstantin Belousov &lt;<a href="mailto:kostikbel@gmail.com" target="_blank">kostikbel@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Fri, Sep 05, 2025 at 01:36:39AM +0200, obiwac wrote:<br>
&gt; Hi!<br>
&gt; <br>
&gt; When trying to access a large file with sshfs (on fuse), I get a<br>
&gt; kernel panic because fuse_internal_cache_attrs is asserting a write<br>
&gt; lock when it is sometimes being called from fuse_internal_do_getattr,<br>
&gt; which only asserts a read lock.<br>
&gt; <br>
&gt; To me (i.e. someone who has never touched VFS or fuse code) this code<br>
&gt; looks wrong, and fuse_internal_do_getattr should be acquiring a write<br>
&gt; lock around its call to fuse_internal_cache_attrs, but clearly it has<br>
&gt; been working just fine for a while now as this code hasn&#39;t changed<br>
&gt; super recently so I could be missing something.<br>
It is only the assertions that were enabled recently.<br>
<br>
Mark merged DEBUG_VFS_LOCKS option into INVARIANTS.<br></blockquote><div><br></div><div> I&#39;m not surprised to see bugs like this one, for the reason Kib stated.  I suspect that there are many more, because DEBUG_VFS_LOCKS was historically rarely used.  If you can come up with an easy reproduction case, please open a ticket on bugzilla and CC me.  And BTW, my FreeBSD user name is &quot;asomers&quot;, not &quot;alan.somers&quot;.</div></div></div>
</div>
home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAOtMX2gr2uFBHbvHDgcwZiihYZ5tCNKxmz6=5bY2F=vfu7O5Ug>