Re: Fuse issue with attr caching expecting write lock

From: Konstantin Belousov <kostikbel_at_gmail.com>
Date: Fri, 05 Sep 2025 00:14:43 UTC
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.