From owner-freebsd-current@FreeBSD.ORG Mon Feb 8 14:50:57 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B818106568D; Mon, 8 Feb 2010 14:50:57 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 1E5018FC22; Mon, 8 Feb 2010 14:50:57 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 9D51B46B1A; Mon, 8 Feb 2010 09:50:56 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id C919E8A024; Mon, 8 Feb 2010 09:50:55 -0500 (EST) From: John Baldwin To: freebsd-current@freebsd.org, bzeeb+freebsd+lor@zabbadoz.net Date: Mon, 8 Feb 2010 09:00:44 -0500 User-Agent: KMail/1.12.1 (FreeBSD/7.2-CBSD-20100120; KDE/4.3.1; amd64; ; ) References: <20100207160031.GA27434@muon.cran.org.uk> In-Reply-To: <20100207160031.GA27434@muon.cran.org.uk> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201002080900.44745.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Mon, 08 Feb 2010 09:50:55 -0500 (EST) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.4 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: Bruce Cran , kib@freebsd.org Subject: Re: LOR: vfs_mount.c (ufs) / msdosfs_vfsops.c (devfs) 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: Mon, 08 Feb 2010 14:50:57 -0000 On Sunday 07 February 2010 11:00:32 am Bruce Cran wrote: > Running -CURRENT from today, I unmounted the msdosfs filesystem on my > phone and got the following LOR: > > lock order reversal: > 1st 0xffffff00c51279f8 ufs (ufs) @ /usr/src/sys/kern/vfs_mount.c:1204 > 2nd 0xffffff010b892278 devfs (devfs) @ > /usr/src/sys/modules/msdosfs/../../fs/msdosfs/msdosfs_vfsops.c:944 > KDB: stack backtrace: > db_trace_self_wrapper() at db_trace_self_wrapper+0x2a > _witness_debugger() at witness_debugger+0x2e > witness_checkorder() at witness_checkorder+0x81e > __lockmgr_args() at __lockmgr_args+0xd11 > vop_stdlock() at vop_stdlock+0x39 > VOP_LOCK1_APV() VOP_LOCK1_APV+0x9b > _vn_lock() at _vn_lock+0x47 > msdosfs_sync() at msdosfs_sync+0x227 > dounmount() at dounmount+0x2ca > unmount() at unmount+0x216 > syscall() at syscall+0x2a2 > Xfast_syscall() at Xfast_syscall+0xe1 > --- syscall (22, FreeBSD ELF64, unmount), rip = 0x8006a1e3c, rsp = > 0x7fffffffe3a8, rbp = 0x800c08010 --- This is due to holding a lock on the coveredvp vnode for most of unmount(2). Probably it should not be held for all of that. Perhaps it is safe to just keep the vnode referenced instead, or could the handling for coveredvp just move to the end of the function where it is now vput? -- John Baldwin