diff options
author | Andrey Vesnovaty <[email protected]> | 2013-07-30 12:59:34 +0300 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2015-09-04 13:23:06 -0700 |
commit | aa9b27080b3411cddf93391bef3090a1a3fcaccc (patch) | |
tree | 346ef158437dc0dade29a036c05a3467c35f8fe0 /module/zfs/zfs_vnops.c | |
parent | e20cd6f7a8922709b1aa2ecefd783390102d79e0 (diff) |
Fix invalid fileid for snapshot root dentry
Prevents NFS client from detection of different fileids of snapshot root dentry
before & after snapshot mount.
Signed-off-by: Andrey Vesnovaty <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Diffstat (limited to 'module/zfs/zfs_vnops.c')
-rw-r--r-- | module/zfs/zfs_vnops.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/module/zfs/zfs_vnops.c b/module/zfs/zfs_vnops.c index 53d02a3aa..944f0ad3d 100644 --- a/module/zfs/zfs_vnops.c +++ b/module/zfs/zfs_vnops.c @@ -2415,6 +2415,16 @@ zfs_getattr_fast(struct inode *ip, struct kstat *sp) mutex_exit(&zp->z_lock); + /* + * Required to prevent NFS client from detecting different inode + * numbers of snapshot root dentry before and after snapshot mount. + */ + if (zsb->z_issnap) { + if (ip->i_sb->s_root->d_inode == ip) + sp->ino = ZFSCTL_INO_SNAPDIRS - + dmu_objset_id(zsb->z_os); + } + ZFS_EXIT(zsb); return (0); |