diff options
author | pjd <pjd@FreeBSD.org> | 2006-03-04 19:41:54 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2006-03-04 19:41:54 +0000 |
commit | ef0f2742d97d0a6284fa4ca22ebf3dce74ecac22 (patch) | |
tree | 3c2c55a540d4ef2116d732189520e5b87df2e8b0 /sys/geom/label | |
parent | 67e8784696f35a9e9c1353c433a3a257a976fab0 (diff) | |
download | FreeBSD-src-ef0f2742d97d0a6284fa4ca22ebf3dce74ecac22.zip FreeBSD-src-ef0f2742d97d0a6284fa4ca22ebf3dce74ecac22.tar.gz |
We need to check if file system size is equal to provider's size, because
sysinstall(8) still bogusly puts first partition at offset 0 instead of 16,
so glabel/ufs will find file system on slice instead of partition.
Before sysinstall is fixed, we must keep this code, which means that we
wont't be able to detect UFS file systems created with 'newfs -s ...'.
PS. bsdlabel(8) creates partitions properly.
MFC after: 3 days
Diffstat (limited to 'sys/geom/label')
-rw-r--r-- | sys/geom/label/g_label_ufs.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/geom/label/g_label_ufs.c b/sys/geom/label/g_label_ufs.c index f2f29ce..d9aaa3f 100644 --- a/sys/geom/label/g_label_ufs.c +++ b/sys/geom/label/g_label_ufs.c @@ -78,8 +78,13 @@ g_label_ufs_taste(struct g_consumer *cp, char *label, size_t size) if (fs == NULL) continue; /* Check for magic and make sure things are the right size */ - if (fs->fs_magic != FS_UFS1_MAGIC && - fs->fs_magic != FS_UFS2_MAGIC) { + if (fs->fs_magic == FS_UFS1_MAGIC && + fs->fs_old_size * fs->fs_fsize == (int32_t)pp->mediasize) { + /* Valid UFS1. */ + } else if (fs->fs_magic == FS_UFS2_MAGIC && fs->fs_fsize > 0 && + pp->mediasize / fs->fs_fsize == fs->fs_size) { + /* Valid UFS2. */ + } else { g_free(fs); continue; } |