From owner-freebsd-stable@freebsd.org Thu Aug 18 07:55:31 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 E517DBBE8A6 for ; Thu, 18 Aug 2016 07:55:31 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5FFAE1B55; Thu, 18 Aug 2016 07:55:31 +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 u7I7tPfR064295 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Thu, 18 Aug 2016 10:55:26 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u7I7tPfR064295 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u7I7tPJC064293; Thu, 18 Aug 2016 10:55:25 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 18 Aug 2016 10:55:25 +0300 From: Konstantin Belousov To: Rick Macklem Cc: Mark Johnston , FreeBSD Stable , Harry Schmalzbauer 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] Message-ID: <20160818075525.GY83214@kib.kiev.ua> References: <57A79E24.8000100@omnilan.de> <57A83C78.1070403@omnilan.de> <20160809060213.GA67664@raichu> <57A9A6C0.9060609@omnilan.de> <20160812123950.GO83214@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.1 (2016-04-27) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home 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: Thu, 18 Aug 2016 07:55:32 -0000 On Thu, Aug 18, 2016 at 12:03:33AM +0000, Rick Macklem wrote: > 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. The patch looks good to me, from the visual shape of it.