OpenZFS on Linux and FreeBSD
Go to file
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
.github Add new wiki page to CONTRIBUTING 2018-09-18 08:58:15 -07:00
cmd Refcounted DSL Crypto Key Mappings 2018-10-03 09:47:11 -07:00
config Fix statfs(2) for 32-bit user space 2018-09-24 17:11:25 -07:00
contrib pyzfs: add missing libzfs_core functions 2018-08-20 10:11:52 -07:00
etc Minor documentation, logging, and testing typos 2018-06-07 09:38:39 -07:00
include Refcounted DSL Crypto Key Mappings 2018-10-03 09:47:11 -07:00
lib Fix "zfs destroy" when "sharenfs=on" is used 2018-10-03 10:17:58 -07:00
man OpenZFS 9763 - zfs(1M): broken formatting in allow/unallow description 2018-10-02 16:12:54 -07:00
module OpenZFS 9677 - panic from zio_write_gang_block() 2018-10-03 09:50:06 -07:00
rpm Remove %changelog from spec file 2018-08-26 12:59:33 -07:00
scripts Direct IO support 2018-08-27 10:04:21 -07:00
tests Fix "zfs destroy" when "sharenfs=on" is used 2018-10-03 10:17:58 -07:00
udev Add kernel module auto-loading 2018-03-13 10:45:55 -07:00
.gitignore Ignore *.o.ur-safe build artifacts 2018-05-13 18:59:02 -07:00
.gitmodules Add zimport.sh compatibility test script 2014-02-21 12:10:31 -08:00
.travis.yml Add .travis.yml 2017-11-13 09:18:18 -08:00
AUTHORS Update build system and packaging 2018-05-29 16:00:33 -07:00
COPYRIGHT Update build system and packaging 2018-05-29 16:00:33 -07:00
LICENSE Update build system and packaging 2018-05-29 16:00:33 -07:00
META Tag 0.8.0-rc1 2018-09-07 09:35:09 -07:00
Makefile.am Add NEWS file 2018-09-18 12:03:47 -07:00
NEWS Add NEWS file 2018-09-18 12:03:47 -07:00
NOTICE Update build system and packaging 2018-05-29 16:00:33 -07:00
README.md Explicitly state supported Linux versions 2018-05-30 20:11:19 -07:00
TEST Update build system and packaging 2018-05-29 16:00:33 -07:00
autogen.sh Cause autogen.sh to fail if autoreconf fails 2018-07-06 09:27:37 -07:00
configure.ac Fixes for procfs files backed by linked lists 2018-09-26 11:08:12 -07:00
copy-builtin copy-builtin: SPL must be in Kbuild first 2018-06-15 15:16:29 -07:00
zfs.release.in Move zfs.release generation to configure step 2012-07-12 12:22:51 -07:00

README.md

img

ZFS on Linux is an advanced file system and volume manager which was originally developed for Solaris and is now maintained by the OpenZFS community.

codecov coverity

Official Resources

Installation

Full documentation for installing ZoL on your favorite Linux distribution can be found at our site.

Contribute & Develop

We have a separate document with contribution guidelines.

Release

ZFS on Linux is released under a CDDL license.
For more details see the NOTICE, LICENSE and COPYRIGHT files; UCRL-CODE-235197

Supported Kernels

  • The META file contains the officially recognized supported kernel versions.