From b40be1142a2cdbfe1a08a350e5f8e5c4b0b7939a Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Fri, 11 May 2018 20:48:39 -0700 Subject: [PATCH] tmpfs - Fix tmpfs_fid, fix NFS exports * Fix the tmpfs_fid structure, the 64-bit elements made it incompatible with the system fid mapping. This fixes NFS exports of a tmpfs filesystem. * Fix tmpfs_fhtovp, the inode number can exceed tmp->tm_nodes_max, do not error-out in that case. --- sys/vfs/tmpfs/tmpfs.h | 2 +- sys/vfs/tmpfs/tmpfs_vfsops.c | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/sys/vfs/tmpfs/tmpfs.h b/sys/vfs/tmpfs/tmpfs.h index 9565f9fde9..14499a6a44 100644 --- a/sys/vfs/tmpfs/tmpfs.h +++ b/sys/vfs/tmpfs/tmpfs.h @@ -383,7 +383,7 @@ struct tmpfs_fid { uint16_t tf_pad; ino_t tf_id; unsigned long tf_gen; -}; +} __packed; /* --------------------------------------------------------------------- */ diff --git a/sys/vfs/tmpfs/tmpfs_vfsops.c b/sys/vfs/tmpfs/tmpfs_vfsops.c index c52163a110..7ee682cf2f 100644 --- a/sys/vfs/tmpfs/tmpfs_vfsops.c +++ b/sys/vfs/tmpfs/tmpfs_vfsops.c @@ -492,9 +492,6 @@ tmpfs_fhtovp(struct mount *mp, struct vnode *rootvp, struct fid *fhp, if (tfhp->tf_len != sizeof(struct tmpfs_fid)) return EINVAL; - if (tfhp->tf_id >= tmp->tm_nodes_max) - return EINVAL; - rc = EINVAL; found = FALSE; -- 2.11.4.GIT