mirror_zfs/tests/zfs-tests/tests/functional/snapshot
Prakash Surya 1bf490ba93 Fix "zfs destroy" when "sharenfs=on" is used
When using "zfs destroy" on a dataset that is using "sharenfs=on" and
has been automatically exported (by libzfs), the dataset will not be
automatically unexported as it should be. This workflow appears to have
been broken by this commit: 3fd3e56cfd

In that change, the "zfs_unmount" function was modified to use the
"mnt.mnt_special" field when determining the mount point that is being
unmounted, rather than "mnt.mnt_mountp".

As a result, when "mntpt" is passed into "zfs_unshare_proto", it's value
is now the dataset name rather than the mountpoint. Thus, when this
value is used with the "is_shared" function (via "zfs_unshare_proto") it
will not find a match (since that function assumes it'll be passed the
mountpoint) and incorrectly reports that the dataset is not shared.

This can be easily reproduced with the following commands:

    $ sudo zpool create tank xvdb
    $ sudo zfs create -o sharenfs=on tank/fish
    $ sudo zfs destroy tank/fish

    $ sudo zfs list -r tank
    NAME   USED  AVAIL  REFER  MOUNTPOINT
    tank  97.5K  7.27G    24K  /tank

    $ sudo exportfs
    /tank/fish      <world>
    $ sudo cat /etc/dfs/sharetab
    /tank/fish      -       nfs     rw,crossmnt

At this point, the "tank/fish" filesystem doesn't exist, but it's still
listed as exported when looking at "exportfs" and "/etc/dfs/sharetab".

Also note, this change brings us back in-sync with the illumos code, as
it pertains to this one line; on illumos, "mnt.mnt_mountp" is used.

Reviewed by: loli10K <ezomori.nozomu@gmail.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Co-authored-by: George Wilson <george.wilson@delphix.com>
Signed-off-by: Prakash Surya <prakash.surya@delphix.com>
Issue #6143
Closes #7941
2018-10-03 10:17:58 -07:00
..
cleanup.ksh Add the ZFS Test Suite 2016-03-16 13:46:16 -07:00
clone_001_pos.ksh ZTS: Adopt OpenZFS test analysis script 2018-06-20 14:03:13 -07:00
Makefile.am Fix "file is executable, but no shebang" warnings 2018-04-06 16:34:21 -07:00
rollback_001_pos.ksh OpenZFS 7290 - ZFS test suite needs to control what utilities it can run 2017-04-06 09:25:36 -07:00
rollback_002_pos.ksh OpenZFS 7290 - ZFS test suite needs to control what utilities it can run 2017-04-06 09:25:36 -07:00
rollback_003_pos.ksh Fix "zfs destroy" when "sharenfs=on" is used 2018-10-03 10:17:58 -07:00
setup.ksh Add the ZFS Test Suite 2016-03-16 13:46:16 -07:00
snapshot_001_pos.ksh OpenZFS 7290 - ZFS test suite needs to control what utilities it can run 2017-04-06 09:25:36 -07:00
snapshot_002_pos.ksh ZTS: remove dead cleanup code from snapshot tests 2018-05-06 21:02:10 -07:00
snapshot_003_pos.ksh OpenZFS 7290 - ZFS test suite needs to control what utilities it can run 2017-04-06 09:25:36 -07:00
snapshot_004_pos.ksh OpenZFS 7290 - ZFS test suite needs to control what utilities it can run 2017-04-06 09:25:36 -07:00
snapshot_005_pos.ksh OpenZFS 7290 - ZFS test suite needs to control what utilities it can run 2017-04-06 09:25:36 -07:00
snapshot_006_pos.ksh ZTS: remove dead cleanup code from snapshot tests 2018-05-06 21:02:10 -07:00
snapshot_007_pos.ksh OpenZFS 7290 - ZFS test suite needs to control what utilities it can run 2017-04-06 09:25:36 -07:00
snapshot_008_pos.ksh Enable remaining tests 2017-05-22 12:34:32 -04:00
snapshot_009_pos.ksh ZTS: Fix snapshot_009_pos, snapshot_010_pos 2018-10-01 17:15:57 -07:00
snapshot_010_pos.ksh ZTS: Fix snapshot_009_pos, snapshot_010_pos 2018-10-01 17:15:57 -07:00
snapshot_011_pos.ksh OpenZFS 7290 - ZFS test suite needs to control what utilities it can run 2017-04-06 09:25:36 -07:00
snapshot_012_pos.ksh OpenZFS 7290 - ZFS test suite needs to control what utilities it can run 2017-04-06 09:25:36 -07:00
snapshot_013_pos.ksh OpenZFS 7290 - ZFS test suite needs to control what utilities it can run 2017-04-06 09:25:36 -07:00
snapshot_014_pos.ksh OpenZFS 7290 - ZFS test suite needs to control what utilities it can run 2017-04-06 09:25:36 -07:00
snapshot_015_pos.ksh OpenZFS 7290 - ZFS test suite needs to control what utilities it can run 2017-04-06 09:25:36 -07:00
snapshot_016_pos.ksh Enable remaining tests 2017-05-22 12:34:32 -04:00
snapshot_017_pos.ksh OpenZFS 7290 - ZFS test suite needs to control what utilities it can run 2017-04-06 09:25:36 -07:00
snapshot.cfg Enable remaining tests 2017-05-22 12:34:32 -04:00