zfs/lib/libshare
Chunwei Chen 9b77d1c958 Fix nfs snapdir automount
The current implementation for allowing nfs to access snapdir is very buggy.
It uses a special fh for snapdirs, such that the next time nfsd does
fh_to_dentry, it actually returns the root inode inside the snapshot. So nfsd
never knows it cross a mountpoint.

The problem is that nfsd will not hold a reference on the vfsmount of the
snapshot. This cause auto unmounter to unmount the snapshot even though nfs is
still holding dentries in it.

To fix this, we return the inode for the snapdirs themselves. However, we also
trigger automount upon fh_to_dentry, and return ESTALE so nfsd will revalidate
and see the mountpoint and do crossmnt.

Because nfsd will now be aware that these are different filesystems users
must add crossmnt to their export options to access snapshot directories.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Chunwei Chen <david.chen@osnexus.com>
Closes #3794
Closes #4716
Closes #5810 
Closes #5833
2017-03-08 09:26:33 -08:00
..
Makefile.am Support parallel build trees (VPATH builds) 2015-07-17 13:42:51 -07:00
libshare.c codebase style improvements for OpenZFS 6459 port 2017-01-22 13:25:40 -08:00
libshare_impl.h cstyle: Resolve C style issues 2013-12-18 16:46:35 -08:00
nfs.c Fix nfs snapdir automount 2017-03-08 09:26:33 -08:00
nfs.h Implemented sharing datasets via NFS using libshare. 2011-07-06 09:20:28 -07:00
smb.c Use cstyle -cpP in `make cstyle` check 2016-12-12 10:46:26 -08:00
smb.h cstyle: Resolve C style issues 2013-12-18 16:46:35 -08:00