From 91f81c42f0fc7bbf4a6e5ce9d0266b84d9afc863 Mon Sep 17 00:00:00 2001 From: Chunwei Chen Date: Fri, 8 Jul 2016 14:51:42 -0700 Subject: [PATCH] fh_to_dentry should return ESTALE when generation mismatch When generation mismatch, it usually means the file pointed by the file handle was deleted. We should return ESTALE to indicate this. We return ENOENT in zfs_vget since zpl_fh_to_dentry will convert it to ESTALE. Signed-off-by: Chunwei Chen Signed-off-by: Brian Behlendorf Issue #4828 --- module/zfs/zfs_vfsops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/zfs/zfs_vfsops.c b/module/zfs/zfs_vfsops.c index cc0cb0a523..b9f1715b53 100644 --- a/module/zfs/zfs_vfsops.c +++ b/module/zfs/zfs_vfsops.c @@ -1634,7 +1634,7 @@ zfs_vget(struct super_block *sb, struct inode **ipp, fid_t *fidp) fid_gen); iput(ZTOI(zp)); ZFS_EXIT(zsb); - return (SET_ERROR(EINVAL)); + return (SET_ERROR(ENOENT)); } *ipp = ZTOI(zp);