summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/arch/alpha/alpha/disksubr.c3
-rw-r--r--sys/arch/amd64/amd64/disksubr.c3
-rw-r--r--sys/arch/arm/arm/disksubr.c3
-rw-r--r--sys/arch/aviion/aviion/disksubr.c3
-rw-r--r--sys/arch/hp300/hp300/disksubr.c3
-rw-r--r--sys/arch/hppa/hppa/disksubr.c3
-rw-r--r--sys/arch/hppa64/hppa64/disksubr.c3
-rw-r--r--sys/arch/i386/i386/disksubr.c3
-rw-r--r--sys/arch/landisk/landisk/disksubr.c3
-rw-r--r--sys/arch/luna88k/luna88k/disksubr.c3
-rw-r--r--sys/arch/mac68k/mac68k/disksubr.c3
-rw-r--r--sys/arch/macppc/macppc/disksubr.c3
-rw-r--r--sys/arch/mvme68k/mvme68k/disksubr.c8
-rw-r--r--sys/arch/mvme88k/mvme88k/disksubr.c8
-rw-r--r--sys/arch/mvmeppc/mvmeppc/disksubr.c3
-rw-r--r--sys/arch/vax/mscp/mscp_disk.c3
-rw-r--r--sys/arch/vax/vax/disksubr.c3
-rw-r--r--sys/arch/vax/vsa/hdc9224.c3
-rw-r--r--sys/isofs/cd9660/cd9660_vfsops.c3
-rw-r--r--sys/isofs/udf/udf_subr.c3
20 files changed, 46 insertions, 24 deletions
diff --git a/sys/arch/alpha/alpha/disksubr.c b/sys/arch/alpha/alpha/disksubr.c
index 695028a8191..04abe22c930 100644
--- a/sys/arch/alpha/alpha/disksubr.c
+++ b/sys/arch/alpha/alpha/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.76 2007/06/07 00:28:16 krw Exp $ */
+/* $OpenBSD: disksubr.c,v 1.77 2007/06/08 05:34:26 deraadt Exp $ */
/* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */
/*
@@ -96,6 +96,7 @@ readbsdlabel(struct buf *bp, void (*strat)(struct buf *),
if (dlp->d_npartitions > MAXPARTITIONS || cksum != 0) {
msg = "disk label corrupted";
} else {
+ DL_SETDSIZE(dlp, DL_GETDSIZE(lp));
*lp = *dlp;
msg = NULL;
break;
diff --git a/sys/arch/amd64/amd64/disksubr.c b/sys/arch/amd64/amd64/disksubr.c
index 9a2eb06fc35..9f9f78d2251 100644
--- a/sys/arch/amd64/amd64/disksubr.c
+++ b/sys/arch/amd64/amd64/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.40 2007/06/07 00:28:16 krw Exp $ */
+/* $OpenBSD: disksubr.c,v 1.41 2007/06/08 05:34:27 deraadt Exp $ */
/* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */
/*
@@ -296,6 +296,7 @@ notfat:
dkcksum(dlp) != 0)
msg = "disk label corrupted";
else {
+ DL_SETDSIZE(dlp, DL_GETDSIZE(lp));
*lp = *dlp;
msg = NULL;
break;
diff --git a/sys/arch/arm/arm/disksubr.c b/sys/arch/arm/arm/disksubr.c
index c7100d48210..3b00e17d913 100644
--- a/sys/arch/arm/arm/disksubr.c
+++ b/sys/arch/arm/arm/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.35 2007/06/07 00:28:16 krw Exp $ */
+/* $OpenBSD: disksubr.c,v 1.36 2007/06/08 05:34:27 deraadt Exp $ */
/* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */
/*
@@ -268,6 +268,7 @@ notfat:
dkcksum(dlp) != 0)
msg = "disk label corrupted";
else {
+ DL_SETDSIZE(dlp, DL_GETDSIZE(lp));
*lp = *dlp;
msg = NULL;
break;
diff --git a/sys/arch/aviion/aviion/disksubr.c b/sys/arch/aviion/aviion/disksubr.c
index 4fe5c259174..26fd574e7f3 100644
--- a/sys/arch/aviion/aviion/disksubr.c
+++ b/sys/arch/aviion/aviion/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.26 2007/06/07 00:28:16 krw Exp $ */
+/* $OpenBSD: disksubr.c,v 1.27 2007/06/08 05:34:27 deraadt Exp $ */
/* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */
/*
@@ -268,6 +268,7 @@ notfat:
dkcksum(dlp) != 0)
msg = "disk label corrupted";
else {
+ DL_SETDSIZE(dlp, DL_GETDSIZE(lp));
*lp = *dlp;
msg = NULL;
break;
diff --git a/sys/arch/hp300/hp300/disksubr.c b/sys/arch/hp300/hp300/disksubr.c
index 54d42d9a91d..3c5d10ed6d0 100644
--- a/sys/arch/hp300/hp300/disksubr.c
+++ b/sys/arch/hp300/hp300/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.33 2007/06/07 00:28:17 krw Exp $ */
+/* $OpenBSD: disksubr.c,v 1.34 2007/06/08 05:34:27 deraadt Exp $ */
/* $NetBSD: disksubr.c,v 1.9 1997/04/01 03:12:13 scottr Exp $ */
/*
@@ -110,6 +110,7 @@ readdisklabel(dev_t dev, void (*strat)(struct buf *),
dkcksum(dlp) != 0)
msg = "disk label corrupted";
else {
+ DL_SETDSIZE(dlp, DL_GETDSIZE(lp));
*lp = *dlp;
msg = NULL;
break;
diff --git a/sys/arch/hppa/hppa/disksubr.c b/sys/arch/hppa/hppa/disksubr.c
index 30f652bc002..afb616a4e22 100644
--- a/sys/arch/hppa/hppa/disksubr.c
+++ b/sys/arch/hppa/hppa/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.57 2007/06/07 02:55:11 krw Exp $ */
+/* $OpenBSD: disksubr.c,v 1.58 2007/06/08 05:34:27 deraadt Exp $ */
/*
* Copyright (c) 1999 Michael Shalayeff
@@ -100,6 +100,7 @@ readbsdlabel(struct buf *bp, void (*strat)(struct buf *),
if (dlp->d_npartitions > MAXPARTITIONS || cksum != 0) {
msg = "disk label corrupted";
} else {
+ DL_SETDSIZE(dlp, DL_GETDSIZE(lp));
*lp = *dlp;
msg = NULL;
break;
diff --git a/sys/arch/hppa64/hppa64/disksubr.c b/sys/arch/hppa64/hppa64/disksubr.c
index 9feb21e710d..cc2a7471f3c 100644
--- a/sys/arch/hppa64/hppa64/disksubr.c
+++ b/sys/arch/hppa64/hppa64/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.40 2007/06/07 02:55:12 krw Exp $ */
+/* $OpenBSD: disksubr.c,v 1.41 2007/06/08 05:34:27 deraadt Exp $ */
/*
* Copyright (c) 1999 Michael Shalayeff
@@ -100,6 +100,7 @@ readbsdlabel(struct buf *bp, void (*strat)(struct buf *),
if (dlp->d_npartitions > MAXPARTITIONS || cksum != 0) {
msg = "disk label corrupted";
} else {
+ DL_SETDSIZE(dlp, DL_GETDSIZE(lp));
*lp = *dlp;
msg = NULL;
break;
diff --git a/sys/arch/i386/i386/disksubr.c b/sys/arch/i386/i386/disksubr.c
index 8bad5b3019a..e89d06347b3 100644
--- a/sys/arch/i386/i386/disksubr.c
+++ b/sys/arch/i386/i386/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.80 2007/06/07 00:28:17 krw Exp $ */
+/* $OpenBSD: disksubr.c,v 1.81 2007/06/08 05:34:28 deraadt Exp $ */
/* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */
/*
@@ -296,6 +296,7 @@ notfat:
dkcksum(dlp) != 0)
msg = "disk label corrupted";
else {
+ DL_SETDSIZE(dlp, DL_GETDSIZE(lp));
*lp = *dlp;
msg = NULL;
break;
diff --git a/sys/arch/landisk/landisk/disksubr.c b/sys/arch/landisk/landisk/disksubr.c
index 24452100b33..8b62b93db7f 100644
--- a/sys/arch/landisk/landisk/disksubr.c
+++ b/sys/arch/landisk/landisk/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.23 2007/06/07 00:28:17 krw Exp $ */
+/* $OpenBSD: disksubr.c,v 1.24 2007/06/08 05:34:28 deraadt Exp $ */
/* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */
/*
@@ -268,6 +268,7 @@ notfat:
dkcksum(dlp) != 0)
msg = "disk label corrupted";
else {
+ DL_SETDSIZE(dlp, DL_GETDSIZE(lp));
*lp = *dlp;
msg = NULL;
break;
diff --git a/sys/arch/luna88k/luna88k/disksubr.c b/sys/arch/luna88k/luna88k/disksubr.c
index a8b9dc1464b..5d5b107605a 100644
--- a/sys/arch/luna88k/luna88k/disksubr.c
+++ b/sys/arch/luna88k/luna88k/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.20 2007/06/07 03:41:52 krw Exp $ */
+/* $OpenBSD: disksubr.c,v 1.21 2007/06/08 05:34:28 deraadt Exp $ */
/* $NetBSD: disksubr.c,v 1.12 2002/02/19 17:09:44 wiz Exp $ */
/*
@@ -182,6 +182,7 @@ readdisklabel(dev_t dev, void (*strat)(struct buf *),
dlp = (struct disklabel *)(clp->cd_block + LABELOFFSET);
if (dlp->d_magic == DISKMAGIC && dlp->d_magic2 == DISKMAGIC) {
if (dkcksum(dlp) == 0) {
+ DL_SETDSIZE(dlp, DL_GETDSIZE(lp));
*lp = *dlp; /* struct assignment */
msg = NULL;
goto done;
diff --git a/sys/arch/mac68k/mac68k/disksubr.c b/sys/arch/mac68k/mac68k/disksubr.c
index d8d2d57e336..64383e3e82d 100644
--- a/sys/arch/mac68k/mac68k/disksubr.c
+++ b/sys/arch/mac68k/mac68k/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.41 2007/06/07 03:41:52 krw Exp $ */
+/* $OpenBSD: disksubr.c,v 1.42 2007/06/08 05:34:28 deraadt Exp $ */
/* $NetBSD: disksubr.c,v 1.22 1997/11/26 04:18:20 briggs Exp $ */
/*
@@ -404,6 +404,7 @@ readdisklabel(dev_t dev, void (*strat)(struct buf *),
dkcksum(dlp) != 0) {
msg = "disk label corrupted";
} else {
+ DL_SETDSIZE(dlp, DL_GETDSIZE(lp));
*lp = *dlp;
}
}
diff --git a/sys/arch/macppc/macppc/disksubr.c b/sys/arch/macppc/macppc/disksubr.c
index 612c595010d..315c26c6ca9 100644
--- a/sys/arch/macppc/macppc/disksubr.c
+++ b/sys/arch/macppc/macppc/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.45 2007/06/07 00:28:17 krw Exp $ */
+/* $OpenBSD: disksubr.c,v 1.46 2007/06/08 05:34:28 deraadt Exp $ */
/* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */
/*
@@ -359,6 +359,7 @@ found_disklabel:
dkcksum(dlp) != 0)
msg = "disk label corrupted";
else {
+ DL_SETDSIZE(dlp, DL_GETDSIZE(lp));
*lp = *dlp;
msg = NULL;
break;
diff --git a/sys/arch/mvme68k/mvme68k/disksubr.c b/sys/arch/mvme68k/mvme68k/disksubr.c
index 1b96862e776..278bb282843 100644
--- a/sys/arch/mvme68k/mvme68k/disksubr.c
+++ b/sys/arch/mvme68k/mvme68k/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.47 2007/06/07 03:41:52 krw Exp $ */
+/* $OpenBSD: disksubr.c,v 1.48 2007/06/08 05:34:28 deraadt Exp $ */
/*
* Copyright (c) 1998 Steve Murphree, Jr.
* Copyright (c) 1995 Dale Rahn.
@@ -382,7 +382,8 @@ cputobsdlabel(struct disklabel *lp, struct cpu_disklabel *clp)
lp->d_ntracks = clp->cfg_hds;
lp->d_secpercyl = clp->secpercyl;
- DL_SETDSIZE(lp, clp->secperunit);
+ if (DL_GETDSIZE(lp) == 0)
+ DL_SETDSIZE(lp, clp->secperunit);
lp->d_sparespertrack = clp->sparespertrack;
lp->d_sparespercyl = clp->sparespercyl;
lp->d_acylinders = clp->acylinders;
@@ -439,7 +440,8 @@ cputobsdlabel(struct disklabel *lp, struct cpu_disklabel *clp)
lp->d_ntracks = clp->cfg_hds;
lp->d_secpercyl = clp->secpercyl;
- DL_SETDSIZE(lp, clp->secperunit);
+ if (DL_GETDSIZE(lp) == 0)
+ DL_SETDSIZE(lp, clp->secperunit);
lp->d_sparespertrack = clp->sparespertrack;
lp->d_sparespercyl = clp->sparespercyl;
lp->d_acylinders = clp->acylinders;
diff --git a/sys/arch/mvme88k/mvme88k/disksubr.c b/sys/arch/mvme88k/mvme88k/disksubr.c
index 9bd51b1dc56..37e746f253b 100644
--- a/sys/arch/mvme88k/mvme88k/disksubr.c
+++ b/sys/arch/mvme88k/mvme88k/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.43 2007/06/07 03:41:52 krw Exp $ */
+/* $OpenBSD: disksubr.c,v 1.44 2007/06/08 05:34:28 deraadt Exp $ */
/*
* Copyright (c) 1998 Steve Murphree, Jr.
* Copyright (c) 1995 Dale Rahn.
@@ -382,7 +382,8 @@ cputobsdlabel(struct disklabel *lp, struct cpu_disklabel *clp)
lp->d_ntracks = clp->cfg_hds;
lp->d_secpercyl = clp->secpercyl;
- DL_SETDSIZE(lp, clp->secperunit);
+ if (DL_GETDSIZE(lp) == 0)
+ DL_SETDSIZE(lp, clp->secperunit);
lp->d_sparespertrack = clp->sparespertrack;
lp->d_sparespercyl = clp->sparespercyl;
lp->d_acylinders = clp->acylinders;
@@ -439,7 +440,8 @@ cputobsdlabel(struct disklabel *lp, struct cpu_disklabel *clp)
lp->d_ntracks = clp->cfg_hds;
lp->d_secpercyl = clp->secpercyl;
- DL_SETDSIZE(lp, clp->secperunit);
+ if (DL_GETDSIZE(lp) == 0)
+ DL_SETDSIZE(lp, clp->secperunit);
lp->d_sparespertrack = clp->sparespertrack;
lp->d_sparespercyl = clp->sparespercyl;
lp->d_acylinders = clp->acylinders;
diff --git a/sys/arch/mvmeppc/mvmeppc/disksubr.c b/sys/arch/mvmeppc/mvmeppc/disksubr.c
index b583c25cb01..60c75641bfc 100644
--- a/sys/arch/mvmeppc/mvmeppc/disksubr.c
+++ b/sys/arch/mvmeppc/mvmeppc/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.41 2007/06/07 00:28:17 krw Exp $ */
+/* $OpenBSD: disksubr.c,v 1.42 2007/06/08 05:34:28 deraadt Exp $ */
/* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */
/*
@@ -271,6 +271,7 @@ notfat:
dkcksum(dlp) != 0)
msg = "disk label corrupted";
else {
+ DL_SETDSIZE(dlp, DL_GETDSIZE(lp));
*lp = *dlp;
msg = NULL;
break;
diff --git a/sys/arch/vax/mscp/mscp_disk.c b/sys/arch/vax/mscp/mscp_disk.c
index 28bfc85d9bc..a68d996fce6 100644
--- a/sys/arch/vax/mscp/mscp_disk.c
+++ b/sys/arch/vax/mscp/mscp_disk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mscp_disk.c,v 1.22 2007/06/07 05:22:32 deraadt Exp $ */
+/* $OpenBSD: mscp_disk.c,v 1.23 2007/06/08 05:35:31 deraadt Exp $ */
/* $NetBSD: mscp_disk.c,v 1.30 2001/11/13 07:38:28 lukem Exp $ */
/*
* Copyright (c) 1996 Ludd, University of Lule}, Sweden.
@@ -875,6 +875,7 @@ rrmakelabel(dl, type)
DL_SETPOFFSET(&dl->d_partitions[0], 0);
DL_SETPOFFSET(&dl->d_partitions[2], 0);
dl->d_interleave = dl->d_headswitch = 1;
+ dl->d_version = 1;
dl->d_magic = dl->d_magic2 = DISKMAGIC;
dl->d_checksum = dkcksum(dl);
}
diff --git a/sys/arch/vax/vax/disksubr.c b/sys/arch/vax/vax/disksubr.c
index 10a7ea3791b..3f1c554baf1 100644
--- a/sys/arch/vax/vax/disksubr.c
+++ b/sys/arch/vax/vax/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.44 2007/06/07 05:22:18 deraadt Exp $ */
+/* $OpenBSD: disksubr.c,v 1.45 2007/06/08 05:34:28 deraadt Exp $ */
/* $NetBSD: disksubr.c,v 1.21 1999/06/30 18:48:06 ragge Exp $ */
/*
@@ -163,6 +163,7 @@ readdisklabel(dev_t dev, void (*strat)(struct buf *),
dkcksum(dlp) != 0)
msg = "disk label corrupted";
else {
+ DL_SETDSIZE(dlp, DL_GETDSIZE(lp));
*lp = *dlp;
}
}
diff --git a/sys/arch/vax/vsa/hdc9224.c b/sys/arch/vax/vsa/hdc9224.c
index 83f63928c50..8dd093dc719 100644
--- a/sys/arch/vax/vsa/hdc9224.c
+++ b/sys/arch/vax/vsa/hdc9224.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hdc9224.c,v 1.17 2007/06/07 05:22:32 deraadt Exp $ */
+/* $OpenBSD: hdc9224.c,v 1.18 2007/06/08 05:35:32 deraadt Exp $ */
/* $NetBSD: hdc9224.c,v 1.16 2001/07/26 15:05:09 wiz Exp $ */
/*
* Copyright (c) 1996 Ludd, University of Lule}, Sweden.
@@ -879,6 +879,7 @@ hdmakelabel(struct disklabel *dl, struct hdgeom *g)
DL_SETPOFFSET(&dl->d_partitions[0], 0);
DL_SETPOFFSET(&dl->d_partitions[2], 0);
dl->d_interleave = dl->d_headswitch = 1;
+ lp->d_version = 1;
dl->d_magic = dl->d_magic2 = DISKMAGIC;
dl->d_checksum = dkcksum(dl);
}
diff --git a/sys/isofs/cd9660/cd9660_vfsops.c b/sys/isofs/cd9660/cd9660_vfsops.c
index 3ae09a46f71..0b1d075aba6 100644
--- a/sys/isofs/cd9660/cd9660_vfsops.c
+++ b/sys/isofs/cd9660/cd9660_vfsops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cd9660_vfsops.c,v 1.45 2007/06/05 00:38:22 deraadt Exp $ */
+/* $OpenBSD: cd9660_vfsops.c,v 1.46 2007/06/08 05:35:32 deraadt Exp $ */
/* $NetBSD: cd9660_vfsops.c,v 1.26 1997/06/13 15:38:58 pk Exp $ */
/*-
@@ -525,6 +525,7 @@ iso_disklabelspoof(dev, strat, lp)
lp->d_npartitions = RAW_PART + 1;
lp->d_bbsize = 8192; /* fake */
lp->d_sbsize = 64*1024; /* fake */
+ lp->d_version = 1;
lp->d_magic = DISKMAGIC;
lp->d_magic2 = DISKMAGIC;
diff --git a/sys/isofs/udf/udf_subr.c b/sys/isofs/udf/udf_subr.c
index 531c9697b1d..1c24b583be7 100644
--- a/sys/isofs/udf/udf_subr.c
+++ b/sys/isofs/udf/udf_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: udf_subr.c,v 1.12 2007/06/05 00:38:22 deraadt Exp $ */
+/* $OpenBSD: udf_subr.c,v 1.13 2007/06/08 05:35:32 deraadt Exp $ */
/*
* Copyright (c) 2006, Miodrag Vallat
@@ -167,6 +167,7 @@ udf_disklabelspoof(dev_t dev, void (*strat)(struct buf *),
DL_SETPSIZE(&lp->d_partitions[RAW_PART], DL_GETDSIZE(lp));
lp->d_partitions[RAW_PART].p_fstype = FS_UDF;
lp->d_npartitions = RAW_PART + 1;
+ lp->d_version = 1;
lp->d_bbsize = 8192; /* Fake. */
lp->d_sbsize = 64*1024; /* Fake. */