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
This commit is contained in:
Alexander Motin 2013-05-20 00:33:54 +00:00
parent 9b9ff7d390
commit 57eed4a86f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=250819

View File

@ -515,7 +515,7 @@ ddf_meta_find_disk(struct ddf_vol_meta *vmeta, uint32_t PD_Reference,
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;