From nobody@FreeBSD.org  Wed Jul 18 08:50:26 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id CBB3A106566B
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 18 Jul 2012 08:50:26 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id B68518FC14
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 18 Jul 2012 08:50:26 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q6I8oQln071129
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 18 Jul 2012 08:50:26 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q6I8oQAH071128;
	Wed, 18 Jul 2012 08:50:26 GMT
	(envelope-from nobody)
Message-Id: <201207180850.q6I8oQAH071128@red.freebsd.org>
Date: Wed, 18 Jul 2012 08:50:26 GMT
From: Claudiu Vasadi <claudiu.vasadi@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: "zfs receive -F" not destroying snapshots that do not exist on the sending side
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         169964
>Category:       bin
>Synopsis:       zfs(8): "zfs receive -F" not destroying snapshots that do not exist on the sending side
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jul 18 09:00:25 UTC 2012
>Closed-Date:    
>Last-Modified:  Wed Jul 18 10:25:43 UTC 2012
>Originator:     Claudiu Vasadi
>Release:        9-STABLE r236943
>Organization:
>Environment:
FreeBSD backup.local 9.0-STABLE FreeBSD 9.0-STABLE #0 r236943: Tue Jun 12 10:08:34 CEST 2012     root@backup.local:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
When sending snapshots to another machine with "zfs receive -F" the snapshots that no longer exist on the sending side, do not get deleted on the receiving side.
>How-To-Repeat:
Something like this would do:

zfs create rpool/test
zfs snapshot rpool/test@snap1
zfs snapshot rpool/test@snap2
zfs snapshot rpool/test@snap3
zfs snapshot rpool/test@snap4
zfs send rpool/test@snap1 | ssh -c arcfour ssh backup.local zfs receive -F backup/test
zfs send -i snap1 rpool/test@snap2 | ssh -c arcfour ssh backup.local zfs receive -F backup/test
zfs send -i snap2 rpool/test@snap3 | ssh -c arcfour ssh backup.local zfs receive -F backup/test
zfs destroy rpool/test@snap1
zfs send -i snap3 rpool/test@snap4 | ssh -c arcfour ssh backup.local zfs receive -F backup/test

PS: Makes no difference if one uses the "-R" flag for "zfs send" or not.
>Fix:


>Release-Note:
>Audit-Trail:
>Unformatted:
