From owner-freebsd-current@FreeBSD.ORG Thu Nov 20 23:32:26 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 C39AA1065670 for ; Thu, 20 Nov 2008 23:32:26 +0000 (UTC) (envelope-from onemda@gmail.com) Received: from yx-out-2324.google.com (yx-out-2324.google.com [74.125.44.28]) by mx1.freebsd.org (Postfix) with ESMTP id 747C78FC1A for ; Thu, 20 Nov 2008 23:32:26 +0000 (UTC) (envelope-from onemda@gmail.com) Received: by yx-out-2324.google.com with SMTP id 8so327542yxb.13 for ; Thu, 20 Nov 2008 15:32:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=hHkvJ/zdHxXa5eP8IP3gSC8P3Jg2/f7SN1cazvTxFZU=; b=rDLsxTbalhLbiUHjEJBS7KwvsWQVCas4KqZqxuGJ1C1abiMpjXoxt/OFoyRhHsSC+e 2BJEGa7NL8tKwVePHCVpoobuUUvMzQcYWWwc9QtY585RD0nLIMDmpdzOg42z9LuH0IBL Cu8shdKok4DkX9Dae7lKMQCagJld9rT4c3EfA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=MoK4+Toe6p5gxUeoLWVY0fx+zDXQjMb2SlkdL1vA81UrponLxB18AM6/BOkVXZcddY OsB7qEulOYMM19I9OX8zZoykdtpKAQ58/zbjmjTogDRQYjo5LC33GZ8OUCGqgKya9tdX sO26v4tJg+3RvypO9SAcV3YqaPi6g+cPQAFVA= Received: by 10.231.12.141 with SMTP id x13mr25324ibx.52.1227223945086; Thu, 20 Nov 2008 15:32:25 -0800 (PST) Received: by 10.231.15.70 with HTTP; Thu, 20 Nov 2008 15:32:25 -0800 (PST) Message-ID: <3a142e750811201532u6e697488w2747242e0a8614a9@mail.gmail.com> Date: Fri, 21 Nov 2008 00:32:25 +0100 From: "Paul B. Mahol" To: "John Baldwin" In-Reply-To: <200811201627.58289.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200811201627.58289.jhb@freebsd.org> 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: Thu, 20 Nov 2008 23:32:26 -0000 On 11/20/08, John Baldwin wrote: > So this patch is fairly minimal since udf(4) is currently read-only. The > changes include: > > * Set VV_ROOT in udf_vget() if we ever return a vnode instead of doing it > only > in udf_root(). This matches the behavior of other operating systems and > correctly tags the root vnode with VV_ROOT in the unlikely case that we > create the vnode during a call to ufs_vget() that does not come from > ufs_root(). > * If the hash lookup in ufs_vget() fails, ensure an exclusive vnode lock is > used while creating the new vnode (same as UFS). > * Allow lock recursion (XXX: not really sure this is needed actually). > * Allow shared vnode locks on non-fifos. > * Honor the requested locking flags (shared vs exclusive) instead of always > using exclusive vnode locks during a lookup operation. > * Handle "." lookups the same way other filesystems do by just bumping the > reference on 'dvp' rather than calling udf_vget(). > > http://www.FreeBSD.org/~jhb/patches/udf_mpsafe.patch > > I have only verified that this compiles and would appreciate it if some > folks > could test this, preferable with INVARIANTS and DEBUG_VFS_LOCKS enabled. I lightly tested it with md(4) on 47M size iso created with k3b (it contains two files) I only got this lor related to udf: lock order reversal: 1st 0xc4449270 udf (udf) @ /usr/src/sys/kern/vfs_lookup.c:442 2nd 0xd7d10850 bufwait (bufwait) @ /usr/src/sys/kern/vfs_bio.c:2443 3rd 0xc4399488 udf (udf) @ /usr/src/sys/modules/udf/../../fs/udf/udf_vfsops.c:625 KDB: stack backtrace: db_trace_self_wrapper(c069d7d4,c3b6181c,c04e745f,4,c0698f19,...) at db_trace_self_wrapper+0x26 kdb_backtrace(4,c0698f19,c3cb7538,c3cb9ca0,c3b61878,...) at kdb_backtrace+0x29 _witness_debugger(c06a04a1,c4399488,c43bc47c,c3cb9ca0,c43bc3f6,...) at _witness_debugger+0x1e witness_checkorder(c4399488,9,c43bc3f6,271,0,...) at witness_checkorder+0x811 __lockmgr_args(c4399488,80000,0,0,0,...) at __lockmgr_args+0x762 udf_vget(c43a2500,4,200000,c3b619bc,0,...) at udf_vget+0x131 udf_lookup(c3b619fc,c4449218,c3b61bb4,c4449218,c3b61a1c,...) at udf_lookup+0x277 VOP_CACHEDLOOKUP_APV(c43bda80,c3b619fc,c3b61bb4,c3b61ba0,c06f9a20,...) at VOP_CACHEDLOOKUP_APV+0xa0 vfs_cache_lookup(c3b61a7c,c3b61a7c,0,200000,c4449218,...) at vfs_cache_lookup+0xc3 VOP_LOOKUP_APV(c43bda80,c3b61a7c,c06a61d2,1ba,c3b61ba0,...) at VOP_LOOKUP_APV+0xaa lookup(c3b61b88,c06a61d2,dc,bc,c4184c2c,...) at lookup+0x507 namei(c3b61b88,c06a5efc,143,0,c4446240,...) at namei+0x45b kern_statat(c4446240,200,ffffff9c,28304c40,0,...) at kern_statat+0x66 kern_lstat(c4446240,28304c40,0,c3b61c1c,0,...) at kern_lstat+0x36 lstat(c4446240,c3b61cf8,8,c06a1154,c06cf170,...) at lstat+0x2b syscall(c3b61d38) at syscall+0x261 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (190, FreeBSD ELF32, lstat), eip = 0x281f132b, esp = 0xbfbfe5ec, ebp = 0xbfbfe6b8 --- lor also happen sometimes when umounting fs.