Re: bad144 - how useful still? Because it's annoyingly ubiquitous.

Jason Thorpe <[email protected]> Sat, 30 May 2026 06:48:15 -0400
Newsgroups gmane.os.netbsd.devel.kernel
Message-ID <[email protected]>
> On May 30, 2026, at 6:37 AM, Jason Thorpe <[email protected]> wrote:
> 
> I mean, if someone ran bad144(8) it might have populated it once.  But upon reboot, nothing would repopulate it from the bad144 table on-disk, read in as part of readdisklabel().

Actually, let me clarify that just a bit more: The code in _wdc_ata_bio_start() would see D_BADSECT in the in-memory copy of the disklabel (in the flags field), which if course would come from reading the on-disk disklabel.

The issue is that the “bad144intern()” function that actually populates the “badsect[]” array used in _wdc_ata_bio_start() is only called from the DIOCSBAD handling in wdioctl().  So _wdc_ata_bio_start() would see D_BADSECT, consult the “badsect[]” array, and then find it to be empty.

-- thorpej