misc/171761: Small patch to (temporarily) remove -r from zfs send usage and zfs(8)

Thomas Steen Rasmussen thomas at gibfest.dk
Wed Sep 19 00:30:11 UTC 2012


>Number:         171761
>Category:       misc
>Synopsis:       Small patch to (temporarily) remove -r from zfs send usage and zfs(8)
>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 Sep 19 00:30:10 UTC 2012
>Closed-Date:
>Last-Modified:
>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 at 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:
>Unformatted:


More information about the freebsd-bugs mailing list