]> git.proxmox.com Git - mirror_zfs.git/commit - cmd/zfs/zfs_main.c
Allow zfs unshare <protocol> -a
authorLOLi <loli10K@users.noreply.github.com>
Tue, 29 Nov 2016 19:22:38 +0000 (20:22 +0100)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 29 Nov 2016 19:22:38 +0000 (12:22 -0700)
commit2f71caf2d926249920d1b9162550c56715cc6461
treef970d0355d9a315d16aac3afc138f2af229b1f8f
parent251cb8dfacb51b9ad7a0e3da305c0bc5bbc1cb9e
Allow zfs unshare <protocol> -a

Allow `zfs unshare <protocol> -a` command to share or unshare all datasets
of a given protocol, nfs or smb.

Additionally, enable most of ZFS Test Suite zfs_share/zfs_unshare test cases.
To work around some Illumos-specific functionalities ($SHARE/$UNSHARE) some
function wrappers were added around them.

Finally, fix and issue in smb_is_share_active() that would leave SMB shares
exported when invoking 'zfs unshare -a'

Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Turbo Fredriksson <turbo@bayour.com>
Signed-off-by: loli10K <ezomori.nozomu@gmail.com>
Closes #3238
Closes #5367
17 files changed:
cmd/zfs/zfs_main.c
config/user-commands.m4
include/libzfs.h
lib/libshare/smb.c
lib/libzfs/libzfs_mount.c
man/man8/zfs.8
tests/runfiles/linux.run
tests/zfs-tests/include/commands.cfg.in
tests/zfs-tests/include/libtest.shlib
tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_005_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_007_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_009_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_unshare/Makefile.am
tests/zfs-tests/tests/functional/cli_root/zfs_unshare/zfs_unshare_001_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_unshare/zfs_unshare_002_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_unshare/zfs_unshare_003_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_unshare/zfs_unshare_006_pos.ksh [new file with mode: 0755]