]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Fix invalid fileid for snapshot root dentry
authorAndrey Vesnovaty <andrey.vesnovaty@gmail.com>
Tue, 30 Jul 2013 09:59:34 +0000 (12:59 +0300)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 4 Sep 2015 20:23:06 +0000 (13:23 -0700)
Prevents NFS client from detection of different fileids of snapshot root dentry
before & after snapshot mount.

Signed-off-by: Andrey Vesnovaty <andrey.vesnovaty@gmail.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
module/zfs/zfs_vnops.c

index 53d02a3aa59cd94003c9a7c0ff2d7cb258252e01..944f0ad3ddb84c544c46392cd4d4f9613232b325 100644 (file)
@@ -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);