From owner-freebsd-current@FreeBSD.ORG Mon Feb 8 14:54:03 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 430361065676; Mon, 8 Feb 2010 14:54:03 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id A7A358FC1C; Mon, 8 Feb 2010 14:54:02 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o18Ershh013787 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 8 Feb 2010 16:53:54 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id o18Ers7V072874; Mon, 8 Feb 2010 16:53:54 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id o18Ersmr072873; Mon, 8 Feb 2010 16:53:54 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 8 Feb 2010 16:53:54 +0200 From: Kostik Belousov To: John Baldwin Message-ID: <20100208145354.GJ9991@deviant.kiev.zoral.com.ua> References: <20100207160031.GA27434@muon.cran.org.uk> <201002080900.44745.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="NgG1H2o5aFKkgPy/" Content-Disposition: inline In-Reply-To: <201002080900.44745.jhb@freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: bzeeb+freebsd+lor@zabbadoz.net, Bruce Cran , freebsd-current@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:54:03 -0000 --NgG1H2o5aFKkgPy/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 08, 2010 at 09:00:44AM -0500, John Baldwin wrote: > On Sunday 07 February 2010 11:00:32 am Bruce Cran wrote: > > Running -CURRENT from today, I unmounted the msdosfs filesystem on my= =20 > > phone and got the following LOR: > >=20 > > lock order reversal: > > 1st 0xffffff00c51279f8 ufs (ufs) @ /usr/src/sys/kern/vfs_mount.c:1204 > > 2nd 0xffffff010b892278 devfs (devfs) @=20 > > /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 =3D 0x8006a1e3c, rsp =3D= =20 > > 0x7fffffffe3a8, rbp =3D 0x800c08010 --- >=20 > 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 ju= st=20 > keep the vnode referenced instead, or could the handling for coveredvp ju= st > move to the end of the function where it is now vput? Among other things, holding vnode lock on covered vnode prevents parallel unmounts of the same mount point. --NgG1H2o5aFKkgPy/ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAktwJYIACgkQC3+MBN1Mb4jTVgCg7KRmdWz9V8kQCe+ybnP7LwiL Fj0AoKffKJuAzWOWllcbKzAJNabzuCKz =v3AH -----END PGP SIGNATURE----- --NgG1H2o5aFKkgPy/--