summaryrefslogtreecommitdiffstats
path: root/sbin/growfs
diff options
context:
space:
mode:
authortrasz <trasz@FreeBSD.org>2012-10-30 21:32:10 +0000
committertrasz <trasz@FreeBSD.org>2012-10-30 21:32:10 +0000
commitff5b37a93e45dfa350cd924478c25f32e87f922a (patch)
tree2c00e9d729a9009b78e4f58c7aab66de552d87a6 /sbin/growfs
parent335b7a9f3cabbf193a9059af1bcc6c52bbe672af (diff)
downloadFreeBSD-src-ff5b37a93e45dfa350cd924478c25f32e87f922a.zip
FreeBSD-src-ff5b37a93e45dfa350cd924478c25f32e87f922a.tar.gz
Fix problem with geom_label(4) not recognizing UFS labels on filesystems
extended using growfs(8). The problem here is that geom_label checks if the filesystem size recorded in UFS superblock is equal to the provider (i.e. device) size. This check cannot be removed due to backward compatibility. On the other hand, in most cases growfs(8) cannot set fs_size in the superblock to match the provider size, because, differently from newfs(8), it cannot recompute cylinder group sizes. To fix this problem, add another superblock field, fs_providersize, used only for this purpose. The geom_label(4) will attach if either fs_size (filesystem created with newfs(8)) or fs_providersize (filesystem expanded using growfs(8)) matches the device size. PR: kern/165962 Reviewed by: mckusick Sponsored by: FreeBSD Foundation
Diffstat (limited to 'sbin/growfs')
-rw-r--r--sbin/growfs/growfs.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sbin/growfs/growfs.c b/sbin/growfs/growfs.c
index 0c16119..ad837a8 100644
--- a/sbin/growfs/growfs.c
+++ b/sbin/growfs/growfs.c
@@ -1498,6 +1498,7 @@ main(int argc, char **argv)
}
sblock.fs_size = dbtofsb(&osblock, size / DEV_BSIZE);
+ sblock.fs_providersize = dbtofsb(&osblock, mediasize / DEV_BSIZE);
/*
* Are we really growing?
OpenPOWER on IntegriCloud