From owner-freebsd-current@FreeBSD.ORG Tue Dec 2 23:30:46 2008 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79599106564A; Tue, 2 Dec 2008 23:30:46 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id F11E78FC1A; Tue, 2 Dec 2008 23:30:45 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [IPv6:::1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id mB2NUdEl012440; Tue, 2 Dec 2008 18:30:40 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Kostik Belousov Date: Tue, 2 Dec 2008 18:28:36 -0500 User-Agent: KMail/1.9.7 References: <200811201627.58289.jhb@freebsd.org> <200811211452.02545.jhb@freebsd.org> <20081122115028.GB6408@deviant.kiev.zoral.com.ua> In-Reply-To: <20081122115028.GB6408@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200812021828.36857.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [IPv6:::1]); Tue, 02 Dec 2008 18:30:40 -0500 (EST) X-Virus-Scanned: ClamAV 0.93.1/8713/Tue Dec 2 14:59:31 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=AWL,BAYES_00,NO_RELAYS autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: scottl@freebsd.org, current@freebsd.org Subject: Re: [PATCH] Make udf(4) MPSAFE and use shared lookups X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2008 23:30:46 -0000 On Saturday 22 November 2008 06:50:28 am Kostik Belousov wrote: > udf_vget() does insmntque() before vnode is fully initialized, allowing > other threads to find the vnode on the mount list. This is typical for > !MPSAFE fs, and it seems corresponding call was not marked XXX for udf. It does the same as ufs. ufs only partially initializes the i-node (as much as both cd9660 and udf do) and then exclusive locks the vnode before insmntque(). They then finish initializing the i-node (bread() the d-node, for example) and finally drop the vnode lock. > udf_lookup for ISDOTDOT case unlocks dvp before vget'ing "..", allowing > the same race on forced unmount as ufs (I will finally commit ufs patch > today). The race happens for !MPSAFE code too, but it is easier to > execute without Giant. Every fs is going to need this workaround it seems. Would be nice if there was an easier way to avoid cut and pasting this code N times. Perhaps we could make lookup() check VI_DOOMED instead? I had changed it do that at one point, but then someone pointed me at the deadfs stuff and said that was sufficient. -- John Baldwin