From owner-freebsd-stable@freebsd.org Sat Aug 20 15:37:44 2016 Return-Path: Delivered-To: freebsd-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30CA6BC08AF for ; Sat, 20 Aug 2016 15:37:44 +0000 (UTC) (envelope-from freebsd@omnilan.de) Received: from mx0.gentlemail.de (mx0.gentlemail.de [IPv6:2a00:e10:2800::a130]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BA7A014BD; Sat, 20 Aug 2016 15:37:43 +0000 (UTC) (envelope-from freebsd@omnilan.de) Received: from mh0.gentlemail.de (ezra.dcm1.omnilan.net [78.138.80.135]) by mx0.gentlemail.de (8.14.5/8.14.5) with ESMTP id u7KFbdkG098675; Sat, 20 Aug 2016 17:37:40 +0200 (CEST) (envelope-from freebsd@omnilan.de) Received: from titan.inop.mo1.omnilan.net (titan.inop.mo1.omnilan.net [IPv6:2001:a60:f0bb:1::3:1]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mh0.gentlemail.de (Postfix) with ESMTPSA id 5C03980C; Sat, 20 Aug 2016 17:37:39 +0200 (CEST) Message-ID: <57B8793E.4070004@omnilan.de> Date: Sat, 20 Aug 2016 17:37:34 +0200 From: Harry Schmalzbauer Organization: OmniLAN User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; de-DE; rv:1.9.2.8) Gecko/20100906 Lightning/1.0b2 Thunderbird/3.1.2 MIME-Version: 1.0 To: Rick Macklem CC: Konstantin Belousov , FreeBSD Stable , Mark Johnston , "kib@FreeBSD.org" Subject: Re: unionfs bugs, a partial patch and some comments [Was: Re: 1-BETA3 Panic: __lockmgr_args: downgrade a recursed lockmgr nfs @ /usr/local/share/deploy-tools/RELENG_11/src/sys/fs/unionfs/union_vnops.c:1905] References: <57A79E24.8000100@omnilan.de> <57A83C78.1070403@omnilan.de> <20160809060213.GA67664@raichu> <57A9A6C0.9060609@omnilan.de> , <20160812123950.GO83214@kib.kiev.ua> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Greylist: ACL 119 matched, not delayed by milter-greylist-4.2.7 (mx0.gentlemail.de [78.138.80.130]); Sat, 20 Aug 2016 17:37:40 +0200 (CEST) X-Milter: Spamilter (Reciever: mx0.gentlemail.de; Sender-ip: 78.138.80.135; Sender-helo: mh0.gentlemail.de; ) X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Aug 2016 15:37:44 -0000 Bezüglich Rick Macklem's Nachricht vom 18.08.2016 02:03 (localtime): > Kostik wrote: > [stuff snipped] >> insmnque() performs the cleanup on its own, and that default cleanup isnot suitable >for the situation. I think that insmntque1() would betterfit your requirements, your >need to move the common code into a helper.It seems that >unionfs_ins_cached_vnode() cleanup could reuse it. > > I've attached an updated patch (untested like the last one). This one creates a > custom version insmntque_stddtr() that first calls unionfs_noderem() and then > does the same stuff as insmntque_stddtr(). This looks like it does the required > stuff (unionfs_noderem() is what the unionfs VOP_RECLAIM() does). > It switches the node back to using its own v_vnlock that is exclusively locked, > among other things. Thanks a lot, today I gave it a try. With this patch, one reproducable panic can still be easily triggered: I have directory A unionfs_mounted under directory B. Then I mount_unionfs the same directory A below another directory C. panic: __lockmgr_args: downgrade a recursed lockmgr nfs @ /usr/local/share/deploy-tools/RELENG_11/src/sys/fs/unionfs/union_vnops.c:1905 Result is this backtrace, hardly helpful I guess: #1 0xffffffff80ae5fd9 in kern_reboot (howto=260) at /usr/local/share/deploy-tools/RELENG_11/src/sys/kern/kern_shutdown.c:366 #2 0xffffffff80ae658b in vpanic (fmt=, ap=) at /usr/local/share/deploy-tools/RELENG_11/src/sys/kern/kern_shutdown.c:759 #3 0xffffffff80ae63c3 in panic (fmt=0x0) at /usr/local/share/deploy-tools/RELENG_11/src/sys/kern/kern_shutdown.c:690 #4 0xffffffff80ab7ab7 in __lockmgr_args (lk=, flags=, ilk=, wmesg=, pri=, timo=, file=, line=) at /usr/local/share/deploy-tools/RELENG_11/src/sys/kern/kern_lock.c:992 #5 0xffffffff80ba510c in vop_stdlock (ap=) at lockmgr.h:98 #6 0xffffffff8111932d in VOP_LOCK1_APV (vop=, a=) at vnode_if.c:2087 #7 0xffffffff80a18cfc in unionfs_lock (ap=0xfffffe007a3ba6a0) at vnode_if.h:859 #8 0xffffffff8111932d in VOP_LOCK1_APV (vop=, a=) at vnode_if.c:2087 #9 0xffffffff80bc9b93 in _vn_lock (vp=, flags=66560, file=, line=) at vnode_if.h:859 #10 0xffffffff80a18460 in unionfs_readdir (ap=) at /usr/local/share/deploy-tools/RELENG_11/src/sys/fs/unionfs/union_vnops.c:1531 #11 0xffffffff81118ecf in VOP_READDIR_APV (vop=, a=) at vnode_if.c:1822 #12 0xffffffff80bc6e3b in kern_getdirentries (td=, fd=, buf=0x800c3d000
, count=, basep=0xfffffe007a3ba980, residp=0x0) at vnode_if.h:758 #13 0xffffffff80bc6bf8 in sys_getdirentries (td=0x0, uap=0xfffffe007a3baa40) at /usr/local/share/deploy-tools/RELENG_11/src/sys/kern/vfs_syscalls.c:3940 #14 0xffffffff80fad6b8 in amd64_syscall (td=, traced=0) at subr_syscall.c:135 #15 0xffffffff80f8feab in Xfast_syscall () at /usr/local/share/deploy-tools/RELENG_11/src/sys/amd64/amd64/exception.S:396 #16 0x0000000000452eea in ?? () Previous frame inner to this frame (corrupt stack? I ran your previous patch with for some time. Similarly, mounting one directory below a 2nd mountpount crashed the machine (forgot to config dumpdir, so can't compare backtrace with the current patch). Otherwise, at least with the previous patch, I haven't had any other panic for about one week. Thanks, -Harry