Add an off_t cast to prevent overflow on media size. This should

fix issues with geometry not matching drive size.

Submitted by:	Clive Lin <clive@tongi.org>
This commit is contained in:
njl 2003-09-22 04:59:07 +00:00
parent 9c61d65266
commit a3b953a825

View File

@ -139,7 +139,7 @@ static int ipsd_attach(device_t dev)
dsc->ipsd_disk.d_fwsectors = IPS_COMP_SECTORS;
}
dsc->ipsd_disk.d_sectorsize = IPS_BLKSIZE;
dsc->ipsd_disk.d_mediasize = totalsectors * IPS_BLKSIZE;
dsc->ipsd_disk.d_mediasize = (off_t)totalsectors * IPS_BLKSIZE;
disk_create(dsc->unit, &dsc->ipsd_disk, 0, NULL, NULL);
device_printf(dev, "Logical Drive (%dMB)\n",