Project

General

Profile

Bug #2811

missing implementation: zfs send -r

Added by Shawn Webb over 8 years ago. Updated about 8 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
zfs - Zettabyte File System
Start date:
2012-06-02
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:

Description

The documentation shows that zfs send should have the -r flag implemented. The usage output for zfs send shows the same. However, zfs send -r hasn't been implemented.

#1

Updated by Shawn Webb over 8 years ago

Relevant discussion from #openindiana IRC channel:

2012-06-02 08:50 < lattera> http://pastebin.com/9MPt5uk1 <- what am I doing wrong? why is `zfs send` saying -r is not valid?
2012-06-02 08:57 < patdk-lap> odd
2012-06-02 08:57 < patdk-lap> are you sure you want -r though? -R is what I use
2012-06-02 08:59 < lattera> I usually use -r, but I could use -R
2012-06-02 08:59 < patdk-lap> hmm
2012-06-02 08:59 < lattera> ah, nvm
2012-06-02 08:59 < lattera> I just looked at my history, I do use -R
2012-06-02 09:01 < tsoome> they are different things tho. did you try to separate -r -p ?
2012-06-02 09:01 < lattera> yeah
2012-06-02 09:02 < tsoome> seems like options parsing bug to me.
2012-06-02 09:02 <@Meths> Looks like a conflict between docs and implementation.
https://hg.openindiana.org/upstream/illumos/illumos-gate/file/6d0517b1a52b/usr/src/cmd/zfs/zfs_main.c#l3502 would seem to
suggest no -r
2012-06-02 09:02 * patdk-lap blames tsoome2012-06-02 09:03 < tsoome> .oO
2012-06-02 09:03 < lattera> the usage output for `zfs send` shows -r, too
2012-06-02 09:04 < tsoome> time to get time for bugreport;)
2012-06-02 09:04 < lattera> well, should the bug report say to implement -r in `zfs send` or to remove -r from documentation?
2012-06-02 09:04 < lattera> I'd love to file it
2012-06-02 09:07 < tsoome> for zfs send imo, because -r and -R semantics are a bit different

#2

Updated by Mike La Spina over 8 years ago

Verified in xref: /illumos-gate/usr/src/cmd/zfs/zfs_main.c
It appears that the usage flags include:

252     case HELP_SEND:
253 return (gettext("\tsend [-DnPpRrv] [-[iI] snapshot] "
254 "&lt;snapshot&gt;\n"));

However it is not included in the case select parse of zfs_do_send:

3502     while ((c = getopt(argc, argv, ":i:I:RDpvnP")) != -1) {
3503 switch (c) {
3504 case 'i':
3505 if (fromname)
3506 usage(B_FALSE);
3507 fromname = optarg;
3508 break;
3509 case 'I':
3510 if (fromname)
3511 usage(B_FALSE);
3512 fromname = optarg;
3513 flags.doall = B_TRUE;
3514 break;
3515 case 'R':
3516 flags.replicate = B_TRUE;
3517 break;
3518 case 'p':
3519 flags.props = B_TRUE;
3520 break;
3521 case 'P':
3522 flags.parsable = B_TRUE;
3523 flags.verbose = B_TRUE;
3524 break;
3525 case 'v':
3526 if (flags.verbose)
3527 extraverbose = B_TRUE;
3528 flags.verbose = B_TRUE;
3529 flags.progress = B_TRUE;
3530 break;
3531 case 'D':
3532 flags.dedup = B_TRUE;
3533 break;
3534 case 'n':
3535 flags.dryrun = B_TRUE;
3536 break;
3537 case ':':
3538 (void) fprintf(stderr, gettext("missing argument for "
3539 "'%c' option\n"), optopt);
3540 usage(B_FALSE);
3541 break;
3542 case '?':
3543 (void) fprintf(stderr, gettext("invalid option '%c'\n"),
3544 optopt);
3545 usage(B_FALSE);
3546 }
3547 }

Thus it's not a viable option at this time and should not be part of the HELP_SEND usage output.

#3

Updated by Yuri Pankov about 8 years ago

  • Category set to zfs - Zettabyte File System
  • Assignee set to Yuri Pankov
  • % Done changed from 0 to 100
  • Difficulty changed from Medium to Bite-size
  • Tags deleted (needs-triage)

Resolved in 13832:8e4bcbc31a4a.

#4

Updated by Yuri Pankov about 8 years ago

  • Status changed from New to Resolved

Also available in: Atom PDF