diff options
author | mav <mav@FreeBSD.org> | 2013-03-07 18:55:37 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2013-03-07 18:55:37 +0000 |
commit | a1b987fb96fceedb0c447645ff9785d5cbd8cd1a (patch) | |
tree | 0e5ccda12a5b270a0665dd1262cd9155421e01bb /sys/geom/raid | |
parent | 98e8f7838c986bc8765c316eb2b7050594f488cd (diff) | |
download | FreeBSD-src-a1b987fb96fceedb0c447645ff9785d5cbd8cd1a.zip FreeBSD-src-a1b987fb96fceedb0c447645ff9785d5cbd8cd1a.tar.gz |
Fix panic when Secondary_Element_Count == 1 and Secondary_Element_Seq
is not set (255).
Reported by: sbruno
MFC after: 1 week
Diffstat (limited to 'sys/geom/raid')
-rw-r--r-- | sys/geom/raid/md_ddf.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/geom/raid/md_ddf.c b/sys/geom/raid/md_ddf.c index 7d4bd1e..c18a319 100644 --- a/sys/geom/raid/md_ddf.c +++ b/sys/geom/raid/md_ddf.c @@ -881,7 +881,10 @@ ddf_vol_meta_update(struct ddf_vol_meta *dst, struct ddf_meta *src, hdr = src->hdr; vde = &src->vdr->entry[ddf_meta_find_vd(src, GUID)]; vdc = ddf_meta_find_vdc(src, GUID); - bvd = GET8D(src, vdc->Secondary_Element_Seq); + if (GET8D(src, vdc->Secondary_Element_Count) == 1) + bvd = 0; + else + bvd = GET8D(src, vdc->Secondary_Element_Seq); size = GET16(src, hdr->Configuration_Record_Length) * src->sectorsize; if (dst->vdc == NULL || |