From nobody Tue Apr 14 12:45:51 2026 X-Original-To: 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 4fw3tD1Tbdz6YVjn for ; Tue, 14 Apr 2026 12:46:12 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) (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 4fw3tC6Tj9z3pCF for ; Tue, 14 Apr 2026 12:46:11 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-6715006f4f7so3552847a12.2 for ; Tue, 14 Apr 2026 05:46:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1776170765; cv=none; d=google.com; s=arc-20240605; b=Vn5w40n0j1tXVaZBuocoz5jhPTncnoxqh2CuY19oR1qGIn6uyCyVGiAnxDEpLlbXUV JuDrnPwtFioIlGXl9v1SV0HNkMieIOFDqUIpVi5rFonNPHpunvK9PHMWKqr90ztkYYaF 3IynEVIjTjDbFrBGBn1dfZ3BZQ8A+NJLCOiiW3KIByzwHZL9bcXQ8EPglXjOwxiGrFg6 Q3j93Y7YUWzU/HOtDgIf75jILgKyASBRcfG1ntVxy3NiabeZCdd6ac3zs0DJ6hAFIaRK WblLuzFPNFVrkB2F92XOc8h7TlCBhlh/3uc6RWI8cMxwFXGaJ4lBMufeJU5f4HJ6eYGZ 6RAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=KKrOQMj7ewOeiEyVKW/Zc+6sfgtdzIOBYajGFhmEzBs=; fh=LgYVcvPvf5xwsitCg3eGR1jep5cgs7EpM2qNONtYrpE=; b=euPoNynej94oaQ+VV4Fu/UnSFccVFZw81lqBrWzoNObzdJpKzuNxdMm1mVoBQU5Y5a RkzKgomd65xUny3QG1CQoPjrvPilMdwQqLWh9ofHLK6w1hZZnqr5vUucGkIhYO3JeLMP ffyj+f9Xfr0I72EeFaUW4T9KXgLMHP7jVk1NJOZKDXKw0U2wZxY+dvMmSrZAfETLbw03 DPDtzEYWUm4wQStdxGYkQrizCn3EGBH49u7LBSNj/D6LyIiZYDgcseWlpabrnqZfd1hH XSev7k0TRU/32hEzuu29OiOk/0587/l//mK1jTlZ6fnBfDYKDoVfqtc/LzIfqZRtfRYZ EJKw==; darn=freebsd.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776170765; x=1776775565; darn=freebsd.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=KKrOQMj7ewOeiEyVKW/Zc+6sfgtdzIOBYajGFhmEzBs=; b=rOTjtLUCq2r5zI7nG+jF9DiKa0xHL1YNSGYss6BkXsHY9R3c/F94FBcdlVLY1bpZ2E vV8N8kPosJb9LRb9P6AINCjNQuNA81+CCOqKud5fF7F2+b7ITc+YJC+k8iP2PHi8g1pm bCiniGxzBH8t7FiG6AeW9N2j6Apx65s02zsDInSkgwrcMse0nrqZamsyVMdL/pWkM069 132uWnsZ3tdwhtiz59im/osgb/ROTMcSH/d5sFk9F1lfg3pgS2dtUwGStWF+k03qtqPQ duioO4mDAr7LpkJO+J89dcn9X9AfEHrWrd3u6soCNxp5nRTJy1z4iQBGEA9x/V08b+/B QhPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776170765; x=1776775565; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=KKrOQMj7ewOeiEyVKW/Zc+6sfgtdzIOBYajGFhmEzBs=; b=YNQig8130h43Hjfn2EIScx1enPmO2+I3vVan5E5ucHAFhu7QxlWAX+T07Ij9xMxgOu O+G4vJsAlmdN35lBITQyxa5dXZajX4gniuDv/0RsGSOqGSMexE2v/aSbWzhpGegyWXRR 4+silEhfjEMzqEZzjhkZVPqDLYyz8nujF7iyN1f2KOFl0dqpv7qAjwOa1zo7u4w+nU2m VQof3xIsQyP3vSDJqLDuf85OiARikh+0JpMZx+mbobPsGYhMbc0jydcnPgZSgcHZ/jEp unSvfV4Dq8IngKGYKOfDvkZBMKLMuLPx5iQOg1836GTsmkLOrWDdnm9PBf0K13E59YLD o9TQ== X-Forwarded-Encrypted: i=1; AFNElJ8E+wCCpOfDwHf9c279Ne+3xffpKqZMw9oVD5U1hBOG3+O3v6YUQsl+UOzsCPOOoXC2E4/DOm43@freebsd.org X-Gm-Message-State: AOJu0YwDRiqtnOF49stmygS0uvifIbhsWoHFSoAdvjZ9P+k1IiqZqHq/ dIcPAWLGY4PqKNmccQ7FIC30vzTa5ffcVEQl3CCkh0P6+IZ8AR/oQGXMYgJbocpucqgxKusVu85 NFa8aVQzzjkif15o2aCxdSLYQjDDGpg== X-Gm-Gg: AeBDieuEoN3UF1ADtNWdrVgkBZJCJz7mkI6hatkLjfwjd8/FMdIVTmtCe3M8FKcn37R xJ5DO6RYId+dvmTlshp1RwXtuY8NtFGwqEnzKPraXFViegzAAlR4RplBo+xbDOaCfmQY4P5dICk oOanqVtS4O3yjdm40okakYSPEjWoJ8xuO08NrcZP7aCndkfFwTDSyjsvyI4TuXkhBI9jwNbR3kO 2amuNWmgY66UZifYB9N3sIIWaj9xSZ7ZKaXmE3+BI7Nhc7iOuRMuwxnyKVchNVSLHMyWSBBAHyM Ds74Ea/Ru5r63YNT7mf31ZJCaU7pbIXggwMbUng= X-Received: by 2002:a05:6402:280c:b0:670:64fd:2301 with SMTP id 4fb4d7f45d1cf-670795162d8mr8327729a12.15.1776170764575; Tue, 14 Apr 2026 05:46:04 -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: <2016260A-5C07-45EE-87CA-73918BA16E83@transactionware.com> <44E3FE9A-4244-49EB-97E0-16080B68F12B@transactionware.com> <0610AE32-DD37-401B-BA04-8C092D61C8B3@transactionware.com> In-Reply-To: From: Rick Macklem Date: Tue, 14 Apr 2026 05:45:51 -0700 X-Gm-Features: AQROBzDpUBNAQdB6AdRK51k14SfN784x6RBBheGTUx9yT8EruJbxdj3_sh3egNk Message-ID: Subject: Re: Panic: cache_vop_rename: lingering negative entry To: Konstantin Belousov Cc: Jan Martin Mikkelsen , current@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Queue-Id: 4fw3tC6Tj9z3pCF X-Spamd-Bar: ---- On Tue, Apr 14, 2026 at 2:53=E2=80=AFAM Konstantin Belousov wrote: > > On Tue, Apr 14, 2026 at 11:45:08AM +0200, Jan Martin Mikkelsen wrote: > > > > > On 13 Apr 2026, at 22:13, Konstantin Belousov wrote= : > > > > > > On Mon, Apr 13, 2026 at 07:12:32PM +0200, Jan Martin Mikkelsen wrote: > > >> > > >>> On 7 Apr 2026, at 20:20, Jan Martin Mikkelsen wrote: > > >>> > > >>> On 7 Apr 2026, at 18:53, Konstantin Belousov wrot= e: > > >>>> > > >>>> On Tue, Apr 07, 2026 at 05:02:05PM +0200, Jan Martin Mikkelsen wro= te: > > >>>>> Hi, > > >>>>> > > >>>>> I am consistently getting the panic below while building lang/per= l5.42. This is the command from the perl build that triggers the panic: > > >>>>> > > >>>>> /usr/bin/strip /ports-work/usr/ports/lang/perl5.42/work/stage/usr= /local/bin/perl5.42.0 > > >>>>> > > >>>>> CURRENT on aarch64, with a kernel from last week, also with a lat= er one from the weekend. A kernel from mid-January worked fine. > > >>>>> > > >>>>> I can reproduce on demand, no parallelism in the build required. > > >>>>> > > >>>>> Does this look familiar to anyone? > > >>>>> > > >>>>> panic: cache_vop_rename: lingering negative entry > > >>>>> cpuid =3D 4 > > >>>>> time =3D 1775410763 > > >>>>> KDB: stack backtrace: > > >>>>> db_trace_self() at db_trace_self > > >>>>> db_trace_self_wrapper() at db_trace_self_wrapper+0x38 > > >>>>> vpanic() at vpanic+0x1a0 > > >>>>> panic() at panic+0x48 > > >>>>> cache_vop_rename() at cache_vop_rename+0xb0 > > >>>>> zfs_do_rename() at zfs_do_rename+0xafc > > >>>>> zfs_freebsd_rename() at zfs_freebsd_rename+0x5c > > >>>>> VOP_RENAME_APV() at VOP_RENAME_APV+0x44 > > >>>>> kern_renameat () at kern_renameat+0x574 > > >>>>> do_el0_sync() at do_el0_sync+0x5f8 > > >>>>> handle_el0_sync() at handle_el0_sync+0x4c > > >>>>> --- exception, esr 0x56000000 > > >>>>> KDB: enter: panic > > >>>>> [ thread pid 81230 tid 101738 ] > > >>>>> Stopped at kdb_enter+0x48: str xzr, [x19, #3072] > > >>>> > > >>>> Is it reproducable on UFS and/or tmpfs? > > >>> > > >>> Successful completion (no panic) when the work directory is on UFS,= and when the work directory is on tmpfs. I didn=E2=80=99t try multiple tim= es, but it never works on ZFS. > > >> > > >> The panic consistently reproduces on a ZFS filesystem with the prope= rties =E2=80=9Cutf8only=3Don=E2=80=9D and "normalization=3DformD=E2=80=9D. > > >> > > >> A ZFS file system with =E2=80=9Cutf8only=3Doff=E2=80=9D and "normali= zation=3Dnone=E2=80=9D works fine. > > >> > > >> As far as I can see, strip makes a simple rename(2) call, and testin= g rename(2) works fine (as expected). Running the same strip command on the= same files on a fresh system works fine. > > >> > > >> The smallest reproducer I have at the moment is building lang/perl5.= 42.0 with a workdir on a ZFS filesystem enforcing UTF8. > > > > > > I am now sure that the reason is that the options you used cause the = same > > > inode to have more than one name (but not hardlinks). I remember tha= t > > > zfs had option to be case-insensitive, but I may mis-remember. > > > > > > The solution, in any case, is to either stop using namecache when the= se > > > options are activated, or at least purge all cached entries that has = the > > > given dst when the dst vnode is renamed or deleted. > > > > > > Somebody who knows zfs would be needed to make the change. > > > > I had a look at the ZFS source, and found this: > > > > /* > > * Only use the name cache if we are looking for a > > * name on a file system that does not require normalization > > * or case folding. We can also look there if we happen to be > > * on a non-normalizing, mixed sensitivity file system IF we > > * are looking for the exact name (which is always the case on > > * FreeBSD). > > */ > > zfsvfs->z_use_namecache =3D !zfsvfs->z_norm || > > ((zfsvfs->z_case =3D=3D ZFS_CASE_MIXED) && > > !(zfsvfs->z_norm & ~U8_TEXTPREP_TOUPPER)); > > > > > > The call to cache_vop_rename() which causes the panic is not protected = by an =E2=80=9Cif (zfsvfs->z_use_namecache)=E2=80=9D, unlike the rest of th= e code that uses that to decide whether or not to use the namecache. > > > > Elsewhere in zfs_vnops_os.c, there is another call to a cache_vop* func= tion, which is protected by a test: > > > > if (zfsvfs->z_use_namecache) > > cache_vop_rmdir(dvp, vp); > > > > It seems to me that this patch could resolve the problem. Does this see= m reasonable? > > > > --- a/src/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c 2= 026-03-28 20:55:06.000000000 1100 > > +++ b/src/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c 2= 026-03-28 20:55:06.000000000 1100 > > @@ -3524,7 +3524,7 @@ > > ZRENAMING, NULL)); > > } > > } > > - if (error =3D=3D 0) { > > + if (error =3D=3D 0 && zfsvfs->z_use_namecache) { > > cache_vop_rename(sdvp, *svpp, tdvp, *tvpp, scnp, = tcnp); > > } > > } > > > > Yes, but please test. > If works for you, please either create a Github PR or a review on the > FreeBSD' phab. I find a Pull Request for OpenZFS on github tends to get mav@'s attention pretty quickly, so I think that is the better way to go. rick >