Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 May 2013 00:33:54 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r250819 - head/sys/geom/raid
Message-ID:  <201305200033.r4K0XspA014492@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Mon May 20 00:33:54 2013
New Revision: 250819
URL: http://svnweb.freebsd.org/changeset/base/250819

Log:
  Fix vdc->Secondary_Element_Count metadata field access from 16 to 8 bit.
  In some cases it could cause kernel panic during failed drive replacement.
  
  Reported by:	trasz
  MFC after:	1 week

Modified:
  head/sys/geom/raid/md_ddf.c

Modified: head/sys/geom/raid/md_ddf.c
==============================================================================
--- head/sys/geom/raid/md_ddf.c	Sun May 19 23:30:24 2013	(r250818)
+++ head/sys/geom/raid/md_ddf.c	Mon May 20 00:33:54 2013	(r250819)
@@ -515,7 +515,7 @@ ddf_meta_find_disk(struct ddf_vol_meta *
 	int i, bvd, pos;
 
 	i = 0;
-	for (bvd = 0; bvd < GET16(vmeta, vdc->Secondary_Element_Count); bvd++) {
+	for (bvd = 0; bvd < GET8(vmeta, vdc->Secondary_Element_Count); bvd++) {
 		if (vmeta->bvdc[bvd] == NULL) {
 			i += GET16(vmeta, vdc->Primary_Element_Count); // XXX
 			continue;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201305200033.r4K0XspA014492>