From owner-freebsd-stable@FreeBSD.ORG Sat Nov 13 11:06:33 2010 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0BAFB106564A; Sat, 13 Nov 2010 11:06:33 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mail.vx.sk (mail.vx.sk [IPv6:2a01:4f8:100:1043::3]) by mx1.freebsd.org (Postfix) with ESMTP id 906F18FC0A; Sat, 13 Nov 2010 11:06:32 +0000 (UTC) Received: from core.vx.sk (localhost [127.0.0.1]) by mail.vx.sk (Postfix) with ESMTP id B9FBE122D76; Sat, 13 Nov 2010 12:06:31 +0100 (CET) X-Virus-Scanned: amavisd-new at mail.vx.sk Received: from mail.vx.sk ([127.0.0.1]) by core.vx.sk (mail.vx.sk [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 8gpd45QMWnIz; Sat, 13 Nov 2010 12:06:27 +0100 (CET) Received: from [10.9.8.1] (188-167-78-139.dynamic.chello.sk [188.167.78.139]) by mail.vx.sk (Postfix) with ESMTPSA id 0D0E3122D5E; Sat, 13 Nov 2010 12:06:27 +0100 (CET) Message-ID: <4CDE7133.6010803@FreeBSD.org> Date: Sat, 13 Nov 2010 12:06:27 +0100 From: Martin Matuska User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; sk; rv:1.8.1.23) Gecko/20090812 Lightning/0.9 Thunderbird/2.0.0.23 Mnenhy/0.7.5.0 MIME-Version: 1.0 To: Andriy Gapon References: <4CDD2F5F.2000902@freebsd.org> <4CDD4EB4.40004@freebsd.org> <4CDDF77B.90708@FreeBSD.org> <4CDE6823.6080907@freebsd.org> In-Reply-To: <4CDE6823.6080907@freebsd.org> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: freebsd-fs@freebsd.org, freebsd-stable@freebsd.org Subject: Re: 8.1-STABLE: problem with unmounting ZFS snapshots X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 11:06:33 -0000 No, this is not good for us. Solaris does not allow "mounting" of snapshots on any vnode, like we do. Solaris has them only in .zfs/snapshots. This allows us to have read-only mounts without even mounting the parent zfs. Before v15 we have been happy with that code and had no issues :-) I have a very simple testcase where just fixing the VFS_RELE breaks our forced unmount. Let's say we use the correct VFS_RELE in zfs_vfsops.c: VFS_RELE(vfsp->mnt_vnodecovered->v_vfsp); Now let's say you have a mounted filesystem (e.g. md) under /mnt: /dev/md5 on /mnt (ufs, local) # mkdir /mnt/test # mount -t zfs tank@t2 /mnt/test # umount -f /mnt Now you will hang because the second VFS_HOLD. So I stick to my opinion that this "extra protection" is more a problem than a solution in our case and it should be commented out. Dňa 13.11.2010 11:27, Andriy Gapon wrote / napísal(a): > on 13/11/2010 04:27 Martin Matuska said the following: >> Yes, this is indeed a leak introduced by importing onnv revision 9214 >> and it exists in perforce as well - very easy to reproduce. >> >> # mount -t zfs test@t1 /mnt >> # umount /mnt (-> hang) >> >> http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6604992 >> http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6810367 >> >> This is not compatible with mounting snapshots outside mounted ZFS and I >> was not able to reproduce the errors defined in 6604992 and 6810367 >> (they are Solaris-specific). I suggest we comment out this code (from >> head, later MFC and p4 as well). >> >> Patch (should work with HEAD and 8-STABLE): >> http://people.freebsd.org/~mm/patches/zfs/zfs_vfsops.c.patch > > Not quite sure, but perhaps it's better to make the logic in each place match > the other. That is, I see that the code does hold on a filesystem of a covered > vnode, but does rele on a parent ZFS filesystem. > Or is this kind of protection not needed at all for FreeBSD? >