summaryrefslogtreecommitdiffstats
path: root/sys/fs/tmpfs/tmpfs_vfsops.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/fs/tmpfs/tmpfs_vfsops.c')
-rw-r--r--sys/fs/tmpfs/tmpfs_vfsops.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/fs/tmpfs/tmpfs_vfsops.c b/sys/fs/tmpfs/tmpfs_vfsops.c
index f0ae6be..d18bccd 100644
--- a/sys/fs/tmpfs/tmpfs_vfsops.c
+++ b/sys/fs/tmpfs/tmpfs_vfsops.c
@@ -185,8 +185,8 @@ tmpfs_mount(struct mount *mp)
ino_t nodes;
int error;
/* Size counters. */
- ino_t nodes_max;
- size_t size_max;
+ ino_t nodes_max;
+ u_quad_t size_max;
/* Root node attributes. */
uid_t root_uid;
@@ -239,7 +239,7 @@ tmpfs_mount(struct mount *mp)
* allowed to use, based on the maximum size the user passed in
* the mount structure. A value of zero is treated as if the
* maximum available space was requested. */
- if (size_max < PAGE_SIZE || size_max >= SIZE_MAX)
+ if (size_max < PAGE_SIZE || size_max > (SIZE_MAX - PAGE_SIZE))
pages = SIZE_MAX;
else
pages = howmany(size_max, PAGE_SIZE);
OpenPOWER on IntegriCloud