From owner-freebsd-fs@FreeBSD.ORG Wed Sep 24 15:21:18 2014 Return-Path: Delivered-To: freebsd-fs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B6F001E1 for ; Wed, 24 Sep 2014 15:21:18 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 95E06BB8 for ; Wed, 24 Sep 2014 15:21:18 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.9/8.14.9) with ESMTP id s8OFLI0r091611 for ; Wed, 24 Sep 2014 15:21:18 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.9/8.14.9/Submit) id s8OFLIve091610 for freebsd-fs@FreeBSD.org; Wed, 24 Sep 2014 15:21:18 GMT (envelope-from bdrewery) Received: (qmail 20704 invoked from network); 24 Sep 2014 10:21:13 -0500 Received: from unknown (HELO ?10.10.0.24?) (freebsd@shatow.net@10.10.0.24) by sweb.xzibition.com with ESMTPA; 24 Sep 2014 10:21:13 -0500 Message-ID: <5422E15F.8050702@FreeBSD.org> Date: Wed, 24 Sep 2014 10:21:03 -0500 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 MIME-Version: 1.0 To: Peter Holm , Konstantin Belousov Subject: Re: Deadlock with umount -f involving tmpfs on top of ZFS on r271170 References: <5420D5FC.4030600@FreeBSD.org> <20140923131244.GC8870@kib.kiev.ua> <5422240F.4080003@FreeBSD.org> <20140924102758.GH8870@kib.kiev.ua> <20140924132605.GA11772@x2.osted.lan> In-Reply-To: <20140924132605.GA11772@x2.osted.lan> OpenPGP: id=6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="6L95Hio9mHWwXDUslpWojPu5fbsVNbV1C" Cc: FreeBSD FS X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Sep 2014 15:21:18 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --6L95Hio9mHWwXDUslpWojPu5fbsVNbV1C Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 9/24/2014 8:26 AM, Peter Holm wrote: > On Wed, Sep 24, 2014 at 01:27:58PM +0300, Konstantin Belousov wrote: >> On Tue, Sep 23, 2014 at 08:53:19PM -0500, Bryan Drewery wrote: >>> I tried your patch and still ran into the deadlock. Here is the debug= >>> information: https://people.freebsd.org/~bdrewery/vfs_deadlock.2.txt >> >> I see what is going on. Previous patch cannot help there. >> >> The problem is that kern_linkat() starts write with vn_start_write(9),= >> and then tries to execute namei(9) with a path potentially crossing >> the mount point. If the mount point is being unmounted, unmount canno= t >> lay suspension on the filesystem due to writer, but it owns the covere= d >> vnode lock. On the other hand, namei(9) is unable to cross the mount >> point since covered vnode is locked, thus writer does not make progres= s. >> >> The similar issue exists in rename code. The deadlock is only possible= >> for filesystems which suspend writes on unmount; such fs are UFS and t= mpfs. >> >> Try this. >> >> diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c >> index b3b7ed5..9775480 100644 >=20 > I had been trying different scenarios without much luck, but with > your description I got the problem instantly. :) >=20 > The patch is an improvement, but: >=20 > http://people.freebsd.org/~pho/stress/log/kostik718.txt >=20 > - Peter >=20 By the way this was my test script: http://dpaste.com/35AYZZ7 It could be simplified a lot. --=20 Regards, Bryan Drewery --6L95Hio9mHWwXDUslpWojPu5fbsVNbV1C Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) iQEcBAEBAgAGBQJUIuFiAAoJEDXXcbtuRpfP7AgIAJfRpz4TgSHCmhkV5dWjuROZ S78/01sl2VNzhK/O1dNSdVEkPmoKbTRGO9nbecLytaVqjUZk8EbbL0DEG07srDoB znXg1b8ASglw2lxqNfQ/849FvwHtHb3aDSNIALBiOctrIPngm4PgnIm5jKTaaAQJ 4j9DwTJ93d5mOw2JzaKZ0Ro7WBmCpx+D9hvfVYPo1sPbvtp5ujkRG+I92iJswq8U +3iiJYBjhFCYZmD3HBV4O7Bbvqa1w3Ip/0UPdsYhwNSlPT6wEL5ujdIcCRFanegy u7zJ+of/dS9mqq/cfc6CIyOJ1uERs9pF5fcLuRntFY//upwVmaZn58ct2uyc7rg= =FsIY -----END PGP SIGNATURE----- --6L95Hio9mHWwXDUslpWojPu5fbsVNbV1C--