From b624374de87c1c68f03cd79440a105e537c6681c Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Sun, 4 May 2003 19:26:31 +0000 Subject: [PATCH] Only accept a rawoffset if it is identical to the mbroffset. --- sys/geom/geom_bsd.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/geom/geom_bsd.c b/sys/geom/geom_bsd.c index dc57791810a0..f696d7d84832 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)