From owner-svn-src-all@FreeBSD.ORG Sun Mar 30 16:51:13 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2C7A65F5; Sun, 30 Mar 2014 16:51:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 192A513F; Sun, 30 Mar 2014 16:51:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2UGpCtH071645; Sun, 30 Mar 2014 16:51:12 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2UGpCmf071644; Sun, 30 Mar 2014 16:51:12 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201403301651.s2UGpCmf071644@svn.freebsd.org> From: Bryan Drewery Date: Sun, 30 Mar 2014 16:51:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263943 - stable/10/sys/fs/tmpfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Mar 2014 16:51:13 -0000 Author: bdrewery Date: Sun Mar 30 16:51:12 2014 New Revision: 263943 URL: http://svnweb.freebsd.org/changeset/base/263943 Log: MFC r263130: Fix -o size less than PAGE_SIZE resulting in SIZE_MAX being used. Modified: stable/10/sys/fs/tmpfs/tmpfs_vfsops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/tmpfs/tmpfs_vfsops.c ============================================================================== --- stable/10/sys/fs/tmpfs/tmpfs_vfsops.c Sun Mar 30 16:49:17 2014 (r263942) +++ stable/10/sys/fs/tmpfs/tmpfs_vfsops.c Sun Mar 30 16:51:12 2014 (r263943) @@ -200,11 +200,13 @@ 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 > OFF_MAX - PAGE_SIZE || + if (size_max == 0 || size_max > OFF_MAX - PAGE_SIZE || (SIZE_MAX < OFF_MAX && size_max / PAGE_SIZE >= SIZE_MAX)) pages = SIZE_MAX; - else + else { + size_max = roundup(size_max, PAGE_SIZE); pages = howmany(size_max, PAGE_SIZE); + } MPASS(pages > 0); if (nodes_max <= 3) {