From ff5b37a93e45dfa350cd924478c25f32e87f922a Mon Sep 17 00:00:00 2001 From: trasz Date: Tue, 30 Oct 2012 21:32:10 +0000 Subject: 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 --- sbin/dumpfs/dumpfs.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sbin/dumpfs') diff --git a/sbin/dumpfs/dumpfs.c b/sbin/dumpfs/dumpfs.c index d560845..a41ca4d 100644 --- a/sbin/dumpfs/dumpfs.c +++ b/sbin/dumpfs/dumpfs.c @@ -277,8 +277,9 @@ dumpfs(const char *name) printf("unknown flags (%#x)", fsflags); putchar('\n'); printf("fsmnt\t%s\n", afs.fs_fsmnt); - printf("volname\t%s\tswuid\t%ju\n", - afs.fs_volname, (uintmax_t)afs.fs_swuid); + printf("volname\t%s\tswuid\t%ju\tprovidersize\t%ju\n", + afs.fs_volname, (uintmax_t)afs.fs_swuid, + (uintmax_t)afs.fs_providersize); printf("\ncs[].cs_(nbfree,ndir,nifree,nffree):\n\t"); afs.fs_csp = calloc(1, afs.fs_cssize); if (bread(&disk, fsbtodb(&afs, afs.fs_csaddr), afs.fs_csp, afs.fs_cssize) == -1) -- cgit v1.1