The size of a filesystem may be less than the size of the provider it

resides on.  Fix the special case of the filesystem fragment size not
evenly dividing the size of the provider.  Fixing the general case
probably requires better superblock validation (left as an exercise to
the reader).
This commit is contained in:
wollman 2005-04-19 21:55:28 +00:00
parent 15eddd96be
commit bc5273fd8f

View File

@ -86,8 +86,8 @@ g_label_ufs_taste(struct g_consumer *cp, char *label, size_t size)
} else if (fs->fs_magic == FS_UFS2_MAGIC) {
G_LABEL_DEBUG(1, "UFS2 file system detected on %s.",
pp->name);
if (fs->fs_size * fs->fs_fsize !=
(int64_t)pp->mediasize) {
if (fs->fs_fsize <= 0 ||
pp->mediasize / fs->fs_fsize != fs->fs_size) {
g_free(fs);
continue;
}