From owner-svn-src-head@FreeBSD.ORG Sat Jan 5 21:42:15 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6E377139; Sat, 5 Jan 2013 21:42:15 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 60F32772; Sat, 5 Jan 2013 21:42:15 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r05LgF6l073907; Sat, 5 Jan 2013 21:42:15 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r05LgFiZ073905; Sat, 5 Jan 2013 21:42:15 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201301052142.r05LgFiZ073905@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 5 Jan 2013 21:42:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245072 - head/sbin/geom/class/journal X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Jan 2013 21:42:15 -0000 Author: kib Date: Sat Jan 5 21:42:14 2013 New Revision: 245072 URL: http://svnweb.freebsd.org/changeset/base/245072 Log: Do not round up the size of the UFS filesystem to the fragment size when comparing its size with the size of the media, to determine if the last disk block is unused. Submitted by: Andreas Longwitz Reviewed by: pjd MFC after: 2 weeks Modified: head/sbin/geom/class/journal/geom_journal_ufs.c Modified: head/sbin/geom/class/journal/geom_journal_ufs.c ============================================================================== --- head/sbin/geom/class/journal/geom_journal_ufs.c Sat Jan 5 21:05:16 2013 (r245071) +++ head/sbin/geom/class/journal/geom_journal_ufs.c Sat Jan 5 21:42:14 2013 (r245072) @@ -70,9 +70,9 @@ g_journal_ufs_using_last_sector(const ch fs = read_superblock(prov); if (fs == NULL) return (0); - /* Provider size in 512 bytes blocks. */ - psize = g_get_mediasize(prov) / DEV_BSIZE; - /* File system size in 512 bytes blocks. */ - fssize = fsbtodb(fs, dbtofsb(fs, psize)); - return (psize == fssize); + /* Provider size in 512 bytes blocks. */ + psize = g_get_mediasize(prov) / DEV_BSIZE; + /* File system size in 512 bytes blocks. */ + fssize = fsbtodb(fs, fs->fs_size); + return (psize <= fssize); }