Index: src/sys/dev/ata/ata-raid.c =================================================================== RCS file: /ncvs/src/sys/dev/ata/ata-raid.c,v retrieving revision 1.130 diff -u -b -p -r1.130 ata-raid.c --- src/sys/dev/ata/ata-raid.c 17 Apr 2008 12:29:35 -0000 1.130 +++ src/sys/dev/ata/ata-raid.c 10 Jul 2008 13:45:27 -0000 @@ -4205,7 +4205,9 @@ DRIVER_MODULE(subdisk, ad, ata_raid_sub_ static int ata_raid_module_event_handler(module_t mod, int what, void *arg) { - int i; + device_t subdisk; + struct ata_raid_subdisk *ars; + int i, disk; switch (what) { case MOD_LOAD: @@ -4244,6 +4246,13 @@ ata_raid_module_event_handler(module_t m mtx_destroy(&rdp->lock); if (rdp->disk) disk_destroy(rdp->disk); + for (disk = 0; disk < rdp->total_disks; disk++) { + subdisk = devclass_get_device(ata_raid_sub_devclass, + device_get_unit(rdp->disks[disk].dev)); + if (subdisk && (ars = device_get_softc(subdisk))) + ars->raid[rdp->volume] = NULL; + } + free(rdp, M_AR); } if (testing || bootverbose) printf("ATA PseudoRAID unloaded\n");