Module Name: src Committed By: andvar Date: Sun Mar 16 12:27:50 UTC 2025
Modified Files: src/sys/dev/ata: ata_raid_subr.c ld_ataraid.c Log Message: ataraid(4), ld(4): ensure RAID disk status is set before resolving vnode. Given a RAID array disk is missing (due to removal, failure, or a code bug), its configuration is skipped. This causes ld(4) attachment at ataraid(4) to fail because adi->adi_dev is NULL. The fix will treat disks without known status (ADI_S_ONLINE, ADI_S_SPARE, ADI_S_ASSIGNED) as if ata_raid_disk_vnode_find() returned NULL, more gracefully solving above situation and avoiding the crash. Additionally, replace vnode block device opening logic with vn_bdev_open() (vn_subr(9)). This function provides identical functionality while also incrementing vp->v_writecount, preventing a 'vp->v_writecount > 0` assertion failure on vn_close(). More details are available in the tech-kern mailing list thread: the https://mail-index.netbsd.org/tech-kern/2025/03/10/msg030179.html thread and PR thread. Should fix PR kern/43986 Also observed in PR kern/59130 (due to a different bug). pullups are needed to netbsd-9, netbsd-10. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/dev/ata/ata_raid_subr.c cvs rdiff -u -r1.50 -r1.51 src/sys/dev/ata/ld_ataraid.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.