On Fri, 8 Jan 2010, Jaakko Heinonen wrote:

Does following patch look reasonable?

- Fix style bugs introduced in r201773.
- Change the type of nodes_max to u_int and use "%u" format string to
 convert its value.

Index: sys/fs/tmpfs/tmpfs_vfsops.c
===================================================================
--- sys/fs/tmpfs/tmpfs_vfsops.c (revision 201818)
+++ sys/fs/tmpfs/tmpfs_vfsops.c (working copy)
@@ -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 - PAGE_SIZE))
+       if (size_max < PAGE_SIZE || size_max > SIZE_MAX - PAGE_SIZE)
                pages = SIZE_MAX;

I think you should change this to use howmany() (or set size_max and
join the else clause) too.

        else
                pages = howmany(size_max, PAGE_SIZE);

OK.  Gleb Kurtsou reported a more interesting problem related to large
values of `pages' being too large.  I'll let you look at this...  IIRC
he made the byte limit UINT_MAX.  Perhaps it should be a small fraction
of the address space (UINT_MAX is still larger than physically possible
for 32-bit systems).

Bruce
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to