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:
mav 2013-05-20 00:33:54 +00:00
parent 3df7f9c0a1
commit da1d4b7e77

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;