From nobody@FreeBSD.org  Wed Sep 19 00:28:31 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 63ED41065670
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 19 Sep 2012 00:28:31 +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 357288FC08
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 19 Sep 2012 00:28:31 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.5/8.14.5) with ESMTP id q8J0SUip092532
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 19 Sep 2012 00:28:30 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.5/8.14.5/Submit) id q8J0SUZk092531;
	Wed, 19 Sep 2012 00:28:30 GMT
	(envelope-from nobody)
Message-Id: <201209190028.q8J0SUZk092531@red.freebsd.org>
Date: Wed, 19 Sep 2012 00:28:30 GMT
From: Thomas Steen Rasmussen <thomas@gibfest.dk>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Small patch to (temporarily) remove -r from zfs send usage and zfs(8)
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         171761
>Category:       kern
>Synopsis:       [zfs] [patch] Small patch to (temporarily) remove -r from zfs send usage and zfs(8)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    mm
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Sep 19 00:30:10 UTC 2012
>Closed-Date:    Tue Oct 16 20:01:12 UTC 2012
>Last-Modified:  Tue Oct 16 20:01:12 UTC 2012
>Originator:     Thomas Steen Rasmussen
>Release:        FreeBSD 9.1-PRERELEASE amd64
>Organization:
>Environment:
FreeBSD glas.tyknet.dk 9.1-PRERELEASE FreeBSD 9.1-PRERELEASE #2: Fri Jul 27 15:32:30 CEST 2012     root@glas.tyknet.dk:/usr/obj/usr/src/sys/TYKJAIL  amd64

>Description:
This thread describes the problem and proposed long-term solution: http://lists.freebsd.org/pipermail/freebsd-fs/2012-September/015052.html

Basically FreeBSD and IllumOS are both missing code to handle the -r switch to zfs send. 

mm@ opened an issue at https://www.illumos.org/issues/3144 which has been closed as a duplicate of https://www.illumos.org/issues/2811 so upstream is working on it.

While we are waiting for a long-term solution from upstream I propose a short-term solution by suggesting that we remove -r from the usage output of "zfs send" and from the zfs(8) manpage.
>How-To-Repeat:
try using zfs send -r, see that the option is unsupported. Also, see that the option is documented in usage and manpage.
>Fix:
1: Apply this patch so we no longer advertise non-existing features
2: Wait until IllumOS upstream fixes problem
3. Import upstream fix when it is ready

Patch attached with submission follows:

diff --git a/cddl/contrib/opensolaris/cmd/zfs/zfs.8 b/cddl/contrib/opensolaris/cmd/zfs/zfs.8
index f83d6b4..245f741 100644
--- a/cddl/contrib/opensolaris/cmd/zfs/zfs.8
+++ b/cddl/contrib/opensolaris/cmd/zfs/zfs.8
@@ -174,7 +174,7 @@
 .Fl a | Ar filesystem Ns | Ns Ar mountpoint
 .Nm
 .Cm send
-.Op Fl DnPpRrv
+.Op Fl DnPpRv
 .Op Fl i Ar snapshot | Fl I Ar snapshot
 .Ar snapshot
 .Nm
@@ -2196,7 +2196,7 @@ file system shared on the system.
 .It Xo
 .Nm
 .Cm send
-.Op Fl DnPpRrv
+.Op Fl DnPpRv
 .Op Fl i Ar snapshot | Fl I Ar snapshot
 .Ar snapshot
 .Xc
@@ -2269,13 +2269,6 @@ be used regardless of the dataset's
 property, but performance will be much better if the filesystem uses a
 dedup-capable checksum (eg.
 .Sy sha256 ) .
-.It Fl r
-Recursively send all descendant snapshots.  This is similar to the
-.Fl R
-flag, but information about deleted and renamed datasets is not included, and
-property information is only included if the
-.Fl p
-flag is specified.
 .It Fl p
 Include the dataset's properties in the stream. This flag is implicit when
 .Fl R
diff --git a/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c b/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c
index ff698a7..aad7122 100644
--- a/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c
+++ b/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c
@@ -267,7 +267,7 @@ get_usage(zfs_help_t idx)
 	case HELP_ROLLBACK:
 		return (gettext("\trollback [-rRf] <snapshot>\n"));
 	case HELP_SEND:
-		return (gettext("\tsend [-DnPpRrv] "
+		return (gettext("\tsend [-DnPpRv] "
 		    "[-i snapshot | -I snapshot] <snapshot>\n"));
 	case HELP_SET:
 		return (gettext("\tset <property=value> "


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-fs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sun Oct 14 23:32:41 UTC 2012 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=171761 

From: Martin Matuska <mm@FreeBSD.org>
To: bug-followup@FreeBSD.org, thomas@gibfest.dk
Cc:  
Subject: Re: kern/171761: [zfs] [patch] Small patch to (temporarily) remove
 -r from zfs send usage and zfs(8)
Date: Tue, 16 Oct 2012 21:51:30 +0200

 This has already been fixed in r240955 and will be committed to 9-STABLE
 together with feature flags after 9.1-RELEASE is out.
 http://svn.freebsd.org/changeset/base/240955
 
 -- 
 Martin Matuska
 FreeBSD committer
 http://blog.vx.sk
 
Responsible-Changed-From-To: freebsd-fs->mm 
Responsible-Changed-By: mm 
Responsible-Changed-When: Tue Oct 16 20:01:03 UTC 2012 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=171761 
State-Changed-From-To: open->closed 
State-Changed-By: mm 
State-Changed-When: Tue Oct 16 20:01:11 UTC 2012 
State-Changed-Why:  
Resolved. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=171761 
>Unformatted:
