From owner-freebsd-bugs@freebsd.org Thu Sep 24 16:14:42 2020 Return-Path: Delivered-To: freebsd-bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B7DEE3FB8C2 for ; Thu, 24 Sep 2020 16:14:42 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 4By0Vp4NFyz4cNd for ; Thu, 24 Sep 2020 16:14:42 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id 947E43FBA3C; Thu, 24 Sep 2020 16:14:42 +0000 (UTC) Delivered-To: bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 944283FBB12 for ; Thu, 24 Sep 2020 16:14:42 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4By0Vp3Ncmz4cbt for ; Thu, 24 Sep 2020 16:14:42 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3E81624A2E for ; Thu, 24 Sep 2020 16:14:42 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 08OGEgbY004129 for ; Thu, 24 Sep 2020 16:14:42 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 08OGEgP6004128 for bugs@FreeBSD.org; Thu, 24 Sep 2020 16:14:42 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 249579] [ZFS] Can't resume a zfs receive stream to a dataset with a mounted clone Date: Thu, 24 Sep 2020 16:14:42 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 12.1-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: asomers@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Sep 2020 16:14:42 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D249579 Bug ID: 249579 Summary: [ZFS] Can't resume a zfs receive stream to a dataset with a mounted clone Product: Base System Version: 12.1-STABLE Hardware: Any OS: Any Status: New Severity: Affects Many People Priority: --- Component: bin Assignee: bugs@FreeBSD.org Reporter: asomers@FreeBSD.org On FreeBSD stable/12, you cannot receive a resumed ZFS stream into a dataset that has a mounted clone. The bug was likely introduced by r364412. The problem is that when receiving libzfs tries to unmount any dataset whose mountpoint might be changed. Such datasets include all children of the destination, as well as all clones of those children. Clones of the destination itself SHOULD NOT be included, but libzfs includes them anyway.= =20 Datasets whose mountpoint property is locally set also SHOULD NOT be includ= ed, but libzfs seems to include them anyway, too. The problem is not reproduci= ble on head (which has switched to OpenZFS), because OpenZFS's libzfs does not = try to unmount datasets when receiving a stream. I don't know why not. Steps to reproduce: > sudo zpool create tank vtbd1 > sudo zfs create tank/src > sudo dd if=3D/dev/zero bs=3D1m count=3D1024 of=3D/tank/src/zerofile 1024+0 records in 1024+0 records out 1073741824 bytes transferred in 8.282515 secs (129639593 bytes/sec) > sudo zfs snapshot tank/src@1 > sudo zfs send -R tank/src@1 | sudo zfs recv -vs tank/dst receiving full stream of tank/src@1 into tank/dst@1 received 1.00GB stream in 4 seconds (257MB/sec) > sudo zfs clone tank/dst@1 tank/clone > # In another shell, cd to /tank/clone > sudo dd if=3D/dev/zero bs=3D1m count=3D1024 of=3D/tank/src/zerofile2 1024+0 records in 1024+0 records out 1073741824 bytes transferred in 5.961812 secs (180103269 bytes/sec) > sudo zfs snapshot tank/src@2 > sudo zfs send -i tank/src@1 tank/src@2 | head -c 536870912 | sudo zfs rec= eive -vs tank/dst receiving incremental stream of tank/src@2 into tank/dst@2 warning: cannot send 'tank/src@2': signal received cannot receive incremental stream: checksum mismatch or incomplete stream. Partially received snapshot is saved. A resuming stream can be generated on the sending system by running: zfs send -t 1-XXXXXX > sudo zfs send -t 1-XXXXXX | sudo zfs receive -vs tank/dst cannot unmount '/tank/clone': Device busy --=20 You are receiving this mail because: You are the assignee for the bug.=