Page MenuHomeFreeBSD

Fix boot hang when Mediasonic HD3-U2B-ME USB disk enclsosure is attached
ClosedPublic

Authored by cy on Aug 3 2018, 2:12 AM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 26 2023, 6:31 PM
Unknown Object (File)
Dec 20 2023, 2:36 AM
Unknown Object (File)
Nov 23 2023, 10:39 PM
Unknown Object (File)
Nov 18 2023, 9:45 PM
Unknown Object (File)
Nov 18 2023, 1:44 PM
Unknown Object (File)
Nov 18 2023, 12:29 PM
Unknown Object (File)
Nov 18 2023, 12:29 PM
Unknown Object (File)
Oct 25 2023, 8:30 AM
Subscribers
None

Details

Summary

When a Mediasonic HD3-U2B-ME PATA to USB enclosure with a disk is attached, loader hangs at line 506 of stand/i386/libi386/biosdisk.c while attempting to read sectors beyond the end of the disk, sector 156906855. I discovered that the Mediasonic enclosure was reporting the disk with 9767 cylinders, 255 heads, 63 sectors/track. That's 156906855 sectors. However camcontrol and Windows 10 both report report the disk having 156301488 sectors, not the calculated value. At line 280 biosdisk.c sets the sectors to the higher of either bd->bd_sectors or the total calculated at line 276 (156906855) instead of the lower and correct value of 156301488 reported by int 13h 48h.

Instead of using the higher of bd_sectors, returned by int13, or the calculated value, this patch uses the safer lower value.

Test Plan

This has been tested using two separate drives in Mediasonic HD3-U2B-ME enclosures resolving the hang in loader at boot time.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Aug 3 2018, 4:55 AM
This revision was automatically updated to reflect the committed changes.