diff options
author | pjd <pjd@FreeBSD.org> | 2006-09-16 11:24:41 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2006-09-16 11:24:41 +0000 |
commit | 5b67d8da02f38ecb700aba41f2c223c9bd29b25b (patch) | |
tree | 0aee762a6933c13905f939e547b8d2db05bf8278 | |
parent | 1328564157924ce95a5ae9e82f2515fb444839e2 (diff) | |
download | FreeBSD-src-5b67d8da02f38ecb700aba41f2c223c9bd29b25b.zip FreeBSD-src-5b67d8da02f38ecb700aba41f2c223c9bd29b25b.tar.gz |
Fix detecting of UFS1 label when mediasize%fragsize != 0.
Submitted by: Stanislav Sedov
PR: kern/84637
MFC after: 1 week
-rw-r--r-- | sys/geom/label/g_label_ufs.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/geom/label/g_label_ufs.c b/sys/geom/label/g_label_ufs.c index d9aaa3f..a1801d5 100644 --- a/sys/geom/label/g_label_ufs.c +++ b/sys/geom/label/g_label_ufs.c @@ -78,8 +78,8 @@ 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_old_size * fs->fs_fsize == (int32_t)pp->mediasize) { + if (fs->fs_magic == FS_UFS1_MAGIC && fs->fs_fsize > 0 && + pp->mediasize / fs->fs_fsize == fs->fs_old_size) { /* Valid UFS1. */ } else if (fs->fs_magic == FS_UFS2_MAGIC && fs->fs_fsize > 0 && pp->mediasize / fs->fs_fsize == fs->fs_size) { |