]> git.proxmox.com Git - mirror_zfs-debian.git/blobdiff - module/zfs/zpl_export.c
Imported Upstream version 0.6.5.3
[mirror_zfs-debian.git] / module / zfs / zpl_export.c
index 23d85cad90747f306e91c693acda09f4007aa3a1..6f051a0485a11208cd3f5e327205ccd4a3d6861d 100644 (file)
@@ -102,8 +102,21 @@ zpl_fh_to_dentry(struct super_block *sb, struct fid *fh,
        rc = zfs_vget(sb, &ip, fid);
        spl_fstrans_unmark(cookie);
 
-       if (rc != 0)
+       if (rc) {
+               /*
+                * If we see ENOENT it might mean that an NFSv4 * client
+                * is using a cached inode value in a file handle and
+                * that the sought after file has had its inode changed
+                * by a third party.  So change the error to ESTALE
+                * which will trigger a full lookup by the client and
+                * will find the new filename/inode pair if it still
+                * exists.
+                */
+               if (rc == ENOENT)
+                       rc = ESTALE;
+
                return (ERR_PTR(-rc));
+       }
 
        ASSERT((ip != NULL) && !IS_ERR(ip));
 
@@ -139,6 +152,9 @@ zpl_commit_metadata(struct inode *inode)
        fstrans_cookie_t cookie;
        int error;
 
+       if (zfsctl_is_node(inode))
+               return (0);
+
        crhold(cr);
        cookie = spl_fstrans_mark();
        error = -zfs_fsync(inode, 0, cr);