Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update zfs program command usage #9428

Merged
merged 1 commit into from
Oct 10, 2019
Merged

Conversation

behlendorf
Copy link
Contributor

Motivation and Context

Issue #9056. Rather than try and force a particular non-portable
behavior for getopt(3) processing update the documentation to
require the -- option parsing terminator.

Description

Update the zfs(8) man page to clearly describe that arguments for
channel programs are to be listed after the -- sentinel which
terminates argument processing. This behavior is supported by
getopt on Linux, FreeBSD, and Illumos according to each platforms
respective man pages.

    zfs program [-jn] [-t instruction-limit] [-m memory-limit]
        pool script [--] arg1 ...

How Has This Been Tested?

The contrib/zcp/autosnap.lua script works as intended on Linux when
the -- is specified. Untested on other platforms, but their respective
getopt(3) man pages describe this functionality as supported.

This is only an update to the documentation.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (a change to man pages or other documentation)

Checklist:

Update the zfs(8) man page to clearly describe that arguments for
channel programs are to be listed after the -- sentinel which
terminates argument processing.  This behavior is supported by
getopt on Linux, FreeBSD, and Illumos according to each platforms
respective man pages.

    zfs program [-jn] [-t instruction-limit] [-m memory-limit]
        pool script [--] arg1 ...

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
@codecov
Copy link

codecov bot commented Oct 9, 2019

Codecov Report

Merging #9428 into master will increase coverage by 0.32%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9428      +/-   ##
==========================================
+ Coverage   79.02%   79.35%   +0.32%     
==========================================
  Files         410      410              
  Lines      122499   122499              
==========================================
+ Hits        96806    97210     +404     
+ Misses      25693    25289     -404
Flag Coverage Δ
#kernel 79.83% <ø> (+0.07%) ⬆️
#user 67.29% <ø> (+0.51%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7b50929...43263fe. Read the comment docs.

@loli10K
Copy link
Contributor

loli10K commented Oct 9, 2019

Tested on Illumos, looks good with and without --:

loli@openindiana:~$ uname -a
SunOS openindiana 5.11 master-0-g77ba330702 i86pc i386 i86pc
loli@openindiana:~$ wget -q https://raw.githubusercontent.com/zfsonlinux/zfs/master/contrib/zcp/autosnap.lua -O autosnap.lua
loli@openindiana:~$ sudo truncate -s 1g /var/tmp/file-vdev
loli@openindiana:~$ sudo zpool create -f -m none testpool /var/tmp/file-vdev
loli@openindiana:~$ sudo zfs create testpool/fs1
loli@openindiana:~$ sudo zfs create testpool/fs2
loli@openindiana:~$ sudo zfs set org.zfsonlinux:auto-snapshot=true testpool
loli@openindiana:~$ sudo zfs set org.illumos:auto-snapshot=true testpool
loli@openindiana:~$ 
loli@openindiana:~$ sudo zfs program testpool autosnap.lua -- -p org.zfsonlinux:auto-snapshot testpool@snap1
Channel program fully executed and produced output:
    return:
        testpool/fs2@snap1: 0
        testpool@snap1: 0
        testpool/fs1@snap1: 0
loli@openindiana:~$ sudo zfs program testpool autosnap.lua -p org.illumos:auto-snapshot testpool@snap2
Channel program fully executed and produced output:
    return:
        testpool/fs1@snap2: 0
        testpool/fs2@snap2: 0
        testpool@snap2: 0
loli@openindiana:~$ zfs list -t snap -r testpool
NAME                 USED  AVAIL  REFER  MOUNTPOINT
testpool@snap1          0      -    24K  -
testpool@snap2          0      -    24K  -
testpool/fs1@snap1      0      -    24K  -
testpool/fs1@snap2      0      -    24K  -
testpool/fs2@snap1      0      -    24K  -
testpool/fs2@snap2      0      -    24K  -
loli@openindiana:~$ 

@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Oct 9, 2019
@behlendorf behlendorf merged commit f3dc4a8 into openzfs:master Oct 10, 2019
tonyhutter pushed a commit to tonyhutter/zfs that referenced this pull request Dec 26, 2019
Update the zfs(8) man page to clearly describe that arguments for
channel programs are to be listed after the -- sentinel which
terminates argument processing.  This behavior is supported by
getopt on Linux, FreeBSD, and Illumos according to each platforms
respective man pages.

    zfs program [-jn] [-t instruction-limit] [-m memory-limit]
        pool script [--] arg1 ...

Reviewed-by: Clint Armstrong <clint@clintarmstrong.net>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: loli10K <ezomori.nozomu@gmail.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes openzfs#9056
Closes openzfs#9428
tonyhutter pushed a commit to tonyhutter/zfs that referenced this pull request Dec 27, 2019
Update the zfs(8) man page to clearly describe that arguments for
channel programs are to be listed after the -- sentinel which
terminates argument processing.  This behavior is supported by
getopt on Linux, FreeBSD, and Illumos according to each platforms
respective man pages.

    zfs program [-jn] [-t instruction-limit] [-m memory-limit]
        pool script [--] arg1 ...

Reviewed-by: Clint Armstrong <clint@clintarmstrong.net>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: loli10K <ezomori.nozomu@gmail.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes openzfs#9056
Closes openzfs#9428
tonyhutter pushed a commit that referenced this pull request Jan 23, 2020
Update the zfs(8) man page to clearly describe that arguments for
channel programs are to be listed after the -- sentinel which
terminates argument processing.  This behavior is supported by
getopt on Linux, FreeBSD, and Illumos according to each platforms
respective man pages.

    zfs program [-jn] [-t instruction-limit] [-m memory-limit]
        pool script [--] arg1 ...

Reviewed-by: Clint Armstrong <clint@clintarmstrong.net>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: loli10K <ezomori.nozomu@gmail.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #9056
Closes #9428
@behlendorf behlendorf deleted the issue-9056 branch April 19, 2021 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Ready to integrate (reviewed, tested) Type: Documentation Indicates a requested change to the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants