From a460c4d98bfbcfe6a8806ca36b0c1561326d108f Mon Sep 17 00:00:00 2001 From: kib Date: Sat, 5 Jan 2013 21:42:14 +0000 Subject: 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 --- sbin/geom/class/journal/geom_journal_ufs.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'sbin/geom') diff --git a/sbin/geom/class/journal/geom_journal_ufs.c b/sbin/geom/class/journal/geom_journal_ufs.c index c847a88..0497beb 100644 --- a/sbin/geom/class/journal/geom_journal_ufs.c +++ b/sbin/geom/class/journal/geom_journal_ufs.c @@ -70,9 +70,9 @@ g_journal_ufs_using_last_sector(const char *prov) 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); } -- cgit v1.1