Changeset View
Changeset View
Standalone View
Standalone View
head/sys/geom/raid/md_ddf.c
Show First 20 Lines • Show All 1,154 Lines • ▼ Show 20 Lines | if (slba != -1 && (slba + len) * ss >= pp->mediasize) | ||||
goto hdrerror; | goto hdrerror; | ||||
/* Workaround for Adaptec implementation. */ | /* Workaround for Adaptec implementation. */ | ||||
if (GET16(meta, hdr->Max_Primary_Element_Entries) == 0xffff) { | if (GET16(meta, hdr->Max_Primary_Element_Entries) == 0xffff) { | ||||
SET16(meta, hdr->Max_Primary_Element_Entries, | SET16(meta, hdr->Max_Primary_Element_Entries, | ||||
min(GET16(meta, hdr->Max_PD_Entries), | min(GET16(meta, hdr->Max_PD_Entries), | ||||
(GET16(meta, hdr->Configuration_Record_Length) * ss - 512) / 12)); | (GET16(meta, hdr->Configuration_Record_Length) * ss - 512) / 12)); | ||||
} | } | ||||
if (GET32(meta, hdr->cd_length) * ss >= MAXPHYS || | if (GET32(meta, hdr->cd_length) * ss >= maxphys || | ||||
GET32(meta, hdr->pdr_length) * ss >= MAXPHYS || | GET32(meta, hdr->pdr_length) * ss >= maxphys || | ||||
GET32(meta, hdr->vdr_length) * ss >= MAXPHYS || | GET32(meta, hdr->vdr_length) * ss >= maxphys || | ||||
GET32(meta, hdr->cr_length) * ss >= MAXPHYS || | GET32(meta, hdr->cr_length) * ss >= maxphys || | ||||
GET32(meta, hdr->pdd_length) * ss >= MAXPHYS || | GET32(meta, hdr->pdd_length) * ss >= maxphys || | ||||
GET32(meta, hdr->bbmlog_length) * ss >= MAXPHYS) { | GET32(meta, hdr->bbmlog_length) * ss >= maxphys) { | ||||
G_RAID_DEBUG(1, "%s: Blocksize is too big.", pp->name); | G_RAID_DEBUG(1, "%s: Blocksize is too big.", pp->name); | ||||
goto hdrerror; | goto hdrerror; | ||||
} | } | ||||
/* Read controller data. */ | /* Read controller data. */ | ||||
buf = g_read_data(cp, (lba + GET32(meta, hdr->cd_section)) * ss, | buf = g_read_data(cp, (lba + GET32(meta, hdr->cd_section)) * ss, | ||||
GET32(meta, hdr->cd_length) * ss, &error); | GET32(meta, hdr->cd_length) * ss, &error); | ||||
if (buf == NULL) | if (buf == NULL) | ||||
▲ Show 20 Lines • Show All 1,911 Lines • Show Last 20 Lines |