mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-30 10:44:09 +03:00
Support accessing .zfs/snapshot via NFS
This patch is based on the previous work done by @andrey-ve and @yshui. It triggers the automount by using kern_path() to traverse to the known snapshout mount point. Once the snapshot is mounted NFS can access the contents of the snapshot. Allowing NFS clients to access to the .zfs/snapshot directory would normally mean that a root user on a client mounting an export with 'no_root_squash' would be able to use mkdir/rmdir/mv to manipulate snapshots on the server. To prevent configuration mistakes a zfs_admin_snapshot module option was added which disables the mkdir/rmdir/mv functionally. System administators desiring this functionally must explicitly enable it. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #2797 Closes #1655 Closes #616
This commit is contained in:
@@ -1600,6 +1600,8 @@ zfs_vget(struct super_block *sb, struct inode **ipp, fid_t *fidp)
|
||||
zp_gen = zp_gen & gen_mask;
|
||||
if (zp_gen == 0)
|
||||
zp_gen = 1;
|
||||
if ((fid_gen == 0) && (zsb->z_root == object))
|
||||
fid_gen = zp_gen;
|
||||
if (zp->z_unlinked || zp_gen != fid_gen) {
|
||||
dprintf("znode gen (%llu) != fid gen (%llu)\n", zp_gen,
|
||||
fid_gen);
|
||||
|
||||
Reference in New Issue
Block a user