From owner-freebsd-fs@FreeBSD.ORG Fri Jul 19 10:22:18 2013 Return-Path: Delivered-To: freebsd-fs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BBB96A92; Fri, 19 Jul 2013 10:22:18 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id D466BED5; Fri, 19 Jul 2013 10:22:17 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id NAA07981; Fri, 19 Jul 2013 13:22:15 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1V07pG-0009d9-Vk; Fri, 19 Jul 2013 13:22:15 +0300 Message-ID: <51E9131F.1060707@FreeBSD.org> Date: Fri, 19 Jul 2013 13:21:19 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130708 Thunderbird/17.0.7 MIME-Version: 1.0 To: Konstantin Belousov Subject: Re: zfs_rename: another zfs+vfs deadlock References: <51E679FD.3040306@FreeBSD.org> <20130717194557.GU5991@kib.kiev.ua> In-Reply-To: <20130717194557.GU5991@kib.kiev.ua> X-Enigmail-Version: 1.5.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-fs@FreeBSD.org, zfs-devel@FreeBSD.org X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jul 2013 10:22:18 -0000 on 17/07/2013 22:45 Konstantin Belousov said the following: > On Wed, Jul 17, 2013 at 02:03:25PM +0300, Andriy Gapon wrote: >> A scenario to reproduce this bug could be like this. >> mkdir a >> mkdir a/b >> mv some-file a/b/ (in parallel with) stat a/b >> Of course it would have to be repeated many times to hit the right timing >> window. Also, namecache could interfere with this scenario, but I am not sure. >> > > There is no questions or proposals on how to approach the fix, JFYI mail ? I was just reporting the problem and my analysis of it. A question of "how to fix" was implied. > I recommend you to look at the ufs_checkpath() and its use in the > ufs_rename(). Thank you. That code is enlightening. I do not think that the approach is directly applicable to zfs_rename, unfortunately. But I will try to see if the same kind of approach could be used. Also, I noticed that ufs_rename() checks for cross-device rename. Should all filesystems do that or should that check belong to VFS layer (if not already done there)? -- Andriy Gapon