From nobody Sun Sep 07 17:21:54 2025 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cKcMl28fpz66VXh; Sun, 07 Sep 2025 17:22:11 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.41]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cKcMk42HWz3rBF; Sun, 07 Sep 2025 17:22:10 +0000 (UTC) (envelope-from asomers@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=freebsd.org (policy=none); spf=pass (mx1.freebsd.org: domain of asomers@gmail.com designates 209.85.208.41 as permitted sender) smtp.mailfrom=asomers@gmail.com Received: by mail-ed1-f41.google.com with SMTP id 4fb4d7f45d1cf-6237202020bso2030308a12.3; Sun, 07 Sep 2025 10:22:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757265729; x=1757870529; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=R8ELZIptlcATR0J+76VrvIcTSJ5f2pf1Kdo7t9kSRQs=; b=D/Y28yQG3EvDe+WTwsLlge/Mr1zayqsig9phxirAoC0ZKUv2QKYwZzSG7WG7SBZUEo FULffYz0TJnBc0Pxct6+o028uQJfsjsWstdyhXIdehnrdDj/NUYED/jjiWCJlPWAsc31 +q0aML71QDoicNif7RhZEXSJSJ2tLgJLGIQlbzhxBJUVBTACD/x7KG2v5zcCpewByvxz VWvEIwtXkyDK/g+Zlh13ND17vBMjd+0mefByHzw+kRfBewrKWY5arFhh5yKyhBoaMf9b jMChgiOvhNijPXGfzf+4Iu/zLaiUcQAWe2mO+8ty4ngbngWjyd9ayHVQDIGBBNTc+Zsm SzqQ== X-Forwarded-Encrypted: i=1; AJvYcCVcR85bTtjkRgHL2w0IoirWYiOQiF8F8MmXja2kgGiupqbg6nz/T0TE9BieU+9TheBNCl07LAAIDSTVaCMtvtw=@freebsd.org, AJvYcCWx6xKBK0HNhrdIeK12dsyODPHaHOn89Yx64LwT00IzIhNcHFq3bVNysSP+jqouAHgwooRIoeFKGocm2w==@freebsd.org X-Gm-Message-State: AOJu0Yz0bjlvX76f3ektAjK4qsc6/0/s3sHn/yVGeit5ugyGLuqGdCXB HlTJr7dUp20FESeQ9tPVeHorWCoM0TDJz2nT2Eo2HYp+r7YF2S2lvraOW2KU8Y5z4l9+IahQaBD UXZrCW6A2MMfWKk1i5LXJEQ0zlamvzQLhMg== X-Gm-Gg: ASbGncuqS6TElpZm5GVeG9I/DC3ZcbpRQfr9udMm1aVmq3B36zSnuKhkExkSXSjFCcj 8kT7C4g8bVP4L8it2eVKXS94FH/r52aTYA+FWM+JQXnpvIao1CJlBc/3XBC4XMgJhoSVHucz2JW NVHOQo/G/ub6KyAKQC+kw89fgyaelx0iYLBKeLEYAOINIIBESPR3aPmZ8Mm47PyPrgZBSbBtEzz pN2nGnNORZEKG6rqQ== X-Google-Smtp-Source: AGHT+IFcxBnjF510XEWR5PoHT7ZW4PpsbhVUjal596B3b5h74vVHwGU0L2OJrm9jWzHuP7S/vaKrIlxE1Te5VdqBpmI= X-Received: by 2002:a05:6402:27d2:b0:617:b662:2272 with SMTP id 4fb4d7f45d1cf-623786455b1mr4232552a12.33.1757265728603; Sun, 07 Sep 2025 10:22:08 -0700 (PDT) List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@FreeBSD.org MIME-Version: 1.0 References: In-Reply-To: From: Alan Somers Date: Sun, 7 Sep 2025 11:21:54 -0600 X-Gm-Features: AS18NWAKnbM8vm7Q7yfHY7otuMSdxdipXY4RTO1Ysunp3B_Uxcha4Xf5TvlXTTE Message-ID: Subject: Re: Fuse issue with attr caching expecting write lock To: Konstantin Belousov Cc: obiwac , freebsd-current@freebsd.org, freebsd-fs@freebsd.org Content-Type: multipart/alternative; boundary="00000000000087890e063e394f99" X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.88 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.998]; NEURAL_HAM_LONG(-1.00)[-0.996]; NEURAL_HAM_SHORT(-0.99)[-0.989]; FORGED_SENDER(0.30)[asomers@freebsd.org,asomers@gmail.com]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; DMARC_POLICY_SOFTFAIL(0.10)[freebsd.org : SPF not aligned (relaxed), No valid DKIM,none]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; FREEFALL_USER(0.00)[asomers]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; RCVD_IN_DNSWL_NONE(0.00)[209.85.208.41:from]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; RCVD_COUNT_ONE(0.00)[1]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.208.41:from]; FREEMAIL_TO(0.00)[gmail.com]; R_DKIM_NA(0.00)[]; FROM_NEQ_ENVFROM(0.00)[asomers@freebsd.org,asomers@gmail.com]; FROM_HAS_DN(0.00)[]; MISSING_XM_UA(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; ARC_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; MLMMJ_DEST(0.00)[freebsd-current@freebsd.org,freebsd-fs@freebsd.org]; RCPT_COUNT_THREE(0.00)[4] X-Rspamd-Queue-Id: 4cKcMk42HWz3rBF --00000000000087890e063e394f99 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Sep 4, 2025 at 6:15=E2=80=AFPM Konstantin Belousov 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". --00000000000087890e063e394f99 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Thu, Sep 4, 2025 at 6:15=E2=80=AFPM Konstantin B= elousov <kostik= bel@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,<= br> > which only asserts a read lock.
>
> To me (i.e. someone who has never touched VFS or fuse code) this code<= br> > looks wrong, and fuse_internal_do_getattr should be acquiring a write<= br> > lock around its call to fuse_internal_cache_attrs, but clearly it has<= br> > 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.
=C2=A0I'm not surprised to see bugs like this one, for the= reason Kib stated.=C2=A0 I suspect that there are many more, because DEBUG= _VFS_LOCKS was historically rarely used.=C2=A0 If you can come up with an e= asy reproduction case, please open a ticket on bugzilla and CC me.=C2=A0 An= d BTW, my FreeBSD user name is "asomers", not "alan.somers&q= uot;.
--00000000000087890e063e394f99--