1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-16 10:20:30 +00:00

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:
Garrett Wollman 2005-04-19 21:55:28 +00:00
parent 7979b3683c
commit d5e3d722df
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=145306

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;
}