glabel for ufs: size check is overzealous?

Ivan Voras ivoras at freebsd.org
Tue Apr 21 16:19:10 UTC 2009


Andriy Gapon wrote:
> glabel insists that for UFS2 the following must hold true:
> pp->mediasize / fs->fs_fsize == fs->fs_size
> 
> But in reality it doesn't have to be this way, there can be valid reasons to make
> filesystem smaller than available raw media size.
> 
> I understand that this is a good sanity check, but maybe there are other ways to
> extra-check that we see a proper superblock, without imposing the limitation in
> question.

Shouldn't fsck complain of this inconsistency?

If it doesn't and the [UF]FS code doesn't, I don't see why glabel should
continue to check it. Struct fs has a tonne of int32 fields, some of
which are only used for information whose length is a couple of bits -
if checking magic isn't enough (and it probably is), there are other
fields that can be validated.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 258 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-geom/attachments/20090421/e35512df/signature.pgp


More information about the freebsd-geom mailing list