From owner-freebsd-hackers@freebsd.org  Tue Apr  9 08:32:47 2019
Return-Path: <owner-freebsd-hackers@freebsd.org>
Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9E35157982B
 for <freebsd-hackers@mailman.ysv.freebsd.org>;
 Tue,  9 Apr 2019 08:32:47 +0000 (UTC)
 (envelope-from kostikbel@gmail.com)
Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id EA60882B35;
 Tue,  9 Apr 2019 08:32:46 +0000 (UTC)
 (envelope-from kostikbel@gmail.com)
Received: from tom.home (kib@localhost [127.0.0.1])
 by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id x398WY6R080171
 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO);
 Tue, 9 Apr 2019 11:32:37 +0300 (EEST)
 (envelope-from kostikbel@gmail.com)
DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x398WY6R080171
Received: (from kostik@localhost)
 by tom.home (8.15.2/8.15.2/Submit) id x398WYUI080170;
 Tue, 9 Apr 2019 11:32:34 +0300 (EEST)
 (envelope-from kostikbel@gmail.com)
X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com
 using -f
Date: Tue, 9 Apr 2019 11:32:34 +0300
From: Konstantin Belousov <kostikbel@gmail.com>
To: Alan Somers <asomers@freebsd.org>
Cc: FreeBSD Hackers <freebsd-hackers@freebsd.org>
Subject: Re: panic: leaf should be empty
Message-ID: <20190409083234.GP1923@kib.kiev.ua>
References: <CAOtMX2jM4HFpRgRe8s7g0Pi2jHu-7S_1oA=fLbC9Z6a0SO2_PA@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <CAOtMX2jM4HFpRgRe8s7g0Pi2jHu-7S_1oA=fLbC9Z6a0SO2_PA@mail.gmail.com>
User-Agent: Mutt/1.11.4 (2019-03-13)
X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00,
 DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM,
 NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home
X-BeenThere: freebsd-hackers@freebsd.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Technical Discussions relating to FreeBSD
 <freebsd-hackers.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/freebsd-hackers>, 
 <mailto:freebsd-hackers-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-hackers/>
List-Post: <mailto:freebsd-hackers@freebsd.org>
List-Help: <mailto:freebsd-hackers-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/freebsd-hackers>, 
 <mailto:freebsd-hackers-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 09 Apr 2019 08:32:48 -0000

On Mon, Apr 08, 2019 at 06:51:23PM -0600, Alan Somers wrote:
> I'm trying to use cache_enter_timeout to set a timeout on a lookup cache
> entry.  I have code that works with cache_enter, but when I modify it to
> use cache_enter_timeout I get this panic message on a subsequent lookup.
> Does anybody know the magic incantation to using lookup cache timeouts?
There is no magic incantation.  Also there is no lookup cache timeouts,
vfs_cache only saves timestamps and ticks.  Look at nfs client how this is
used.

> The panic message is not very helpful.
The panic message is very explicit and the condition under which it
appears is obvious. If VOP_LOOKUP() method returns error, it must not
set ndp->ni_vp.

> 
> Stack trace:
> panic: leaf should be empty
> cpuid = 2
> time = 1554770500
> KDB: stack backtrace:
> db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame
> 0xfffffe0031c745f0
> vpanic() at vpanic+0x19d/frame 0xfffffe0031c74640
> panic() at panic+0x43/frame 0xfffffe0031c746a0
> lookup() at lookup+0xe69/frame 0xfffffe0031c74740
> namei() at namei+0x4e9/frame 0xfffffe0031c74830
> kern_accessat() at kern_accessat+0x106/frame 0xfffffe0031c74990
> amd64_syscall() at amd64_syscall+0x276/frame 0xfffffe0031c74ab0
> fast_syscall_common() at fast_syscall_common+0x101/frame 0xfffffe0031c74ab0
> --- syscall (33, FreeBSD ELF64, sys_access), rip = 0x80051696a, rsp =
> 0x7fffffffe5e8, rbp = 0x7fffffffe780 ---
> 
> Steps to Reproduce:
> 1) Build and install a kernel and tests from the projects/fuse2 branch at
> r346046 or later
> 2) cd /usr/tests/sys/fs/fusefs
> 3) ./lookup --gtest_filter=Lookup.entry_cache -vv # This should work
> 4) sudo sysctl vfs.fusefs.lookup_cache_expire=1
> 5) ./lookup --gtest_filter=Lookup.entry_cache -vv # This should panic
> 
> The offending code is in sys/fs/fuse/fuse_node.c at line 308.
> 
> Grateful for any help,
> -Alan
> _______________________________________________
> freebsd-hackers@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"