From owner-freebsd-fs@FreeBSD.ORG Wed Oct 6 08:39:40 2010 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B810106564A for ; Wed, 6 Oct 2010 08:39:40 +0000 (UTC) (envelope-from james-freebsd-fs2@jrv.org) Received: from mail.jrv.org (adsl-70-243-84-13.dsl.austtx.swbell.net [70.243.84.13]) by mx1.freebsd.org (Postfix) with ESMTP id E1F338FC13 for ; Wed, 6 Oct 2010 08:39:39 +0000 (UTC) Received: from kremvax.housenet.jrv (kremvax.housenet.jrv [192.168.3.124]) by mail.jrv.org (8.14.3/8.14.3) with ESMTP id o968OZpg088364; Wed, 6 Oct 2010 03:24:36 -0500 (CDT) (envelope-from james-freebsd-fs2@jrv.org) Authentication-Results: mail.jrv.org; domainkeys=pass (testing) header.from=james-freebsd-fs2@jrv.org DomainKey-Signature: a=rsa-sha1; s=enigma; d=jrv.org; c=nofws; q=dns; h=message-id:date:from:user-agent:mime-version:to:cc:subject: references:in-reply-to:x-enigmail-version:content-type:content-transfer-encoding; b=pvp5DYis/aspSytB4xzqbvQwshN02PqvUfMtiePojOlPCFruo2zH1n0d2mCG7aDTm oK9fs62/8p1v1rQbBSViEsdz/rOLyLhkXQ8FaD8a2CYkw9/mBYd0IjwBvPVgHMoZKIY 8RhxQ8Q0r1H0BE2JZroXuRC4WjuZygDwHUPVQuk= Message-ID: <4CAC3243.6040802@jrv.org> Date: Wed, 06 Oct 2010 03:24:35 -0500 From: "James R. Van Artsdalen" User-Agent: Thunderbird 2.0.0.24 (Macintosh/20100228) MIME-Version: 1.0 To: Pawel Jakub Dawidek References: <30455085.1048.1283538007526.JavaMail.root@zimbra> In-Reply-To: <30455085.1048.1283538007526.JavaMail.root@zimbra> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: freebsd-fs Subject: ZFS v28 zfs recv leaves filesystems with wrong names X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2010 08:39:40 -0000 James R. Van Artsdalen wrote: > I get the following assertion with "zfs recv": > > bigback:/root# zfs send -R -I @syssnap-1249124822.2009-08-01.06:07:02.213-30-6 bigtex@syssnap-1254395222.2009-10-01.06:07:02.274-39-4 | ssh kraken zfs recv -dvF bigz > Assertion failed: (!clp->cl_alldependents), file /usr/src/cddl/lib/libzfs/../../../cddl/contrib/opensolaris/lib/libzfs/common/libzfs_changelist.c, line 470. I found a simple reproducible test case. The assertion is correct because an earlier "zfs recv" left the datasets with the wrong names. This test case leaves the pool in the wrong state, which causes a later "zfs recv" to assert/fail (the assertion isn't induced by this script since that's not where the bug is). kraken:/root# uname -a FreeBSD kraken.housenet.jrv 9.0-CURRENT FreeBSD 9.0-CURRENT #3 r212080M: Fri Sep 3 15:43:23 CDT 2010 root@kraken.housenet.jrv:/usr/obj/usr/src/sys/BIGTEX amd64 kraken:/root# cat zt zpool create rec1 da3 zpool create rec2 da4 zfs create rec1/a zfs create rec1/a/b zfs snapshot -r rec1@s1 zfs send -R rec1@s1 | zfs recv -dvuF rec2 zfs rename rec1/a/b rec1/c zfs destroy -r rec1/a zfs create rec1/a zfs rename rec1/c rec1/a/b # if the rename target is anything other than rec1/a/b the "zfs recv" result is right zfs snapshot -r rec1@s2 zfs send -R -I @s1 rec1@s2 | zfs recv -dvuF rec2 kraken:/root# sh -x zt + zpool create rec1 da3 + zpool create rec2 da4 + zfs create rec1/a + zfs create rec1/a/b + zfs snapshot -r rec1@s1 + zfs send -R rec1@s1 + zfs recv -dvuF rec2 receiving full stream of rec1@s1 into rec2@s1 received 47.4KB stream in 2 seconds (23.7KB/sec) receiving full stream of rec1/a@s1 into rec2/a@s1 received 47.9KB stream in 1 seconds (47.9KB/sec) receiving full stream of rec1/a/b@s1 into rec2/a/b@s1 received 46.3KB stream in 1 seconds (46.3KB/sec) + zfs rename rec1/a/b rec1/c + zfs destroy -r rec1/a + zfs create rec1/a + zfs rename rec1/c rec1/a/b + zfs snapshot -r rec1@s2 + zfs send -R -I @s1 rec1@s2 + zfs recv -dvuF rec2 attempting destroy rec2/a@s1 success attempting destroy rec2/a failed - trying rename rec2/a to rec2/recv-2176-1 local fs rec2/a/b new parent not found cannot open 'rec2/a/b': dataset does not exist another pass: attempting destroy rec2/recv-2176-1 failed (0) receiving incremental stream of rec1@s2 into rec2@s2 received 10.8KB stream in 2 seconds (5.41KB/sec) receiving full stream of rec1/a@s2 into rec2/a@s2 received 47.9KB stream in 1 seconds (47.9KB/sec) receiving incremental stream of rec1/a/b@s2 into rec2/recv-2176-1/b@s2 received 312B stream in 2 seconds (156B/sec) local fs rec2/a does not have fromsnap (s1 in stream); must have been deleted locally; ignoring attempting destroy rec2/recv-2176-1 failed (0) kraken:/root# zfs list | grep rec1 rec1 238K 1.78T 32K /rec1 rec1/a 63K 1.78T 32K /rec1/a rec1/a/b 31K 1.78T 31K /rec1/a/b kraken:/root# zfs list | grep rec2 rec2 293K 1.78T 32K /rec2 rec2/a 32K 1.78T 32K /rec2/a rec2/recv-2176-1 64K 1.78T 32K /rec2/recv-2176-1 rec2/recv-2176-1/b 32K 1.78T 31K /rec2/recv-2176-1/b kraken:/root#