From owner-freebsd-current@FreeBSD.ORG Mon Feb 8 15:01:59 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 7450B106568F; Mon, 8 Feb 2010 15:01:59 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-iw0-f198.google.com (mail-iw0-f198.google.com [209.85.223.198]) by mx1.freebsd.org (Postfix) with ESMTP id 29C538FC19; Mon, 8 Feb 2010 15:01:58 +0000 (UTC) Received: by iwn36 with SMTP id 36so864200iwn.3 for ; Mon, 08 Feb 2010 07:01:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=EW4z8JBDKSmwlPFZDGXoJLhL3wnxUTFGdwFxkmjRgk8=; b=QT/2fkaXEYEU+QqIdxfXDfNXnvp2YS5QYKH9xT4rOFpQ2muZ9pCqmBN/0j7IAqqmQ4 M1eKJSwlc20TeCdTVeg82g44TjKv5QhjU0msL9bxcapGmgnL9ArD8mk4Zsrfn9vBDqDr 5H477XHAvG4GEdA0sNTk8EfKnjQ+bjHt4G0kI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=Fo0UCn4tADfrLqnc15rBnp1YNQFHeGaqv8l2j0V+xfibWYkVLJ+pyaJ5soIo6ztGW0 8agw89g/DZ+Yxf1mUAWXbyDHuWuwZHhWNlhkxcjrAIby1PP35DD83VGNCFt9w4F8fFKg 17c4Re7aVX+IWFycp+3RhoWQEPcTlhapwwt9M= MIME-Version: 1.0 Sender: asmrookie@gmail.com Received: by 10.231.190.204 with SMTP id dj12mr396835ibb.9.1265641318112; Mon, 08 Feb 2010 07:01:58 -0800 (PST) In-Reply-To: <20100208145354.GJ9991@deviant.kiev.zoral.com.ua> References: <20100207160031.GA27434@muon.cran.org.uk> <201002080900.44745.jhb@freebsd.org> <20100208145354.GJ9991@deviant.kiev.zoral.com.ua> Date: Mon, 8 Feb 2010 16:01:58 +0100 X-Google-Sender-Auth: cf04b26a463e6f43 Message-ID: <3bbf2fe11002080701u35a3e419ke562735f4f00ce97@mail.gmail.com> From: Attilio Rao To: Kostik Belousov Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 15:01:59 -0000 2010/2/8 Kostik Belousov : > 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 >> > phone and got the following LOR: >> > >> > lock order reversal: >> > =C2=A01st 0xffffff00c51279f8 ufs (ufs) @ /usr/src/sys/kern/vfs_mount.c= :1204 >> > =C2=A02nd 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 =3D 0x8006a1e3c, rsp =3D >> > 0x7fffffffe3a8, rbp =3D 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. =C2=A0Perhaps it is safe= to just >> keep the vnode referenced instead, or could the handling for coveredvp j= ust >> 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. Uhm, I think that this should be hanlded by MNTK_UNMOUNT already (and thus stopping forced unmounts too). Attilio --=20 Peace can only be achieved by understanding - A. Einstein