summaryrefslogtreecommitdiffstats
path: root/sbin/geom
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2013-01-05 21:42:14 +0000
committerkib <kib@FreeBSD.org>2013-01-05 21:42:14 +0000
commita460c4d98bfbcfe6a8806ca36b0c1561326d108f (patch)
tree3e304238141a23bdcd18125c4cfe3d31720495c7 /sbin/geom
parent75ba745d803da6ff1ba15732a854615838be3d0a (diff)
downloadFreeBSD-src-a460c4d98bfbcfe6a8806ca36b0c1561326d108f.zip
FreeBSD-src-a460c4d98bfbcfe6a8806ca36b0c1561326d108f.tar.gz
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 <longwitz@incore.de> Reviewed by: pjd MFC after: 2 weeks
Diffstat (limited to 'sbin/geom')
-rw-r--r--sbin/geom/class/journal/geom_journal_ufs.c10
1 files changed, 5 insertions, 5 deletions
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);
}
OpenPOWER on IntegriCloud