summaryrefslogtreecommitdiffstats
path: root/sys/geom/geom_bsd.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2003-05-04 19:26:31 +0000
committerphk <phk@FreeBSD.org>2003-05-04 19:26:31 +0000
commitaac4aea7595824f27df3054cc2c11e5c5fb1cc6e (patch)
tree5209a46ace868efe8bf89858e9102a08c5596ef0 /sys/geom/geom_bsd.c
parentaa1b7d74dad0878999edfdc7610a90fe86a46a6d (diff)
downloadFreeBSD-src-aac4aea7595824f27df3054cc2c11e5c5fb1cc6e.zip
FreeBSD-src-aac4aea7595824f27df3054cc2c11e5c5fb1cc6e.tar.gz
Only accept a rawoffset if it is identical to the mbroffset.
Diffstat (limited to 'sys/geom/geom_bsd.c')
-rw-r--r--sys/geom/geom_bsd.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/geom/geom_bsd.c b/sys/geom/geom_bsd.c
index dc57791..f696d7d 100644
--- a/sys/geom/geom_bsd.c
+++ b/sys/geom/geom_bsd.c
@@ -131,6 +131,10 @@ g_bsd_modify(struct g_geom *gp, u_char *label)
/* Historical braindamage... */
rawoffset = (off_t)dl.d_partitions[RAW_PART].p_offset * dl.d_secsize;
+
+ if ((off_t)rawoffset * secsize != ms->mbroffset)
+ rawoffset = 0;
+
for (i = 0; i < dl.d_npartitions; i++) {
ppp = &dl.d_partitions[i];
if (ppp->p_size == 0)
OpenPOWER on IntegriCloud