diff options
author | mav <mav@FreeBSD.org> | 2010-03-12 07:49:10 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2010-03-12 07:49:10 +0000 |
commit | 12e9c761ed40f49dcaf693cc7192763a48d9544b (patch) | |
tree | 97e1cda9766502bb3d147a45577658eeb4b7252e /sys/dev/ata | |
parent | 712ef6c0dec2952713beb1ad8d32f9c136ce6078 (diff) | |
download | FreeBSD-src-12e9c761ed40f49dcaf693cc7192763a48d9544b.zip FreeBSD-src-12e9c761ed40f49dcaf693cc7192763a48d9544b.tar.gz |
Mask disk_idx to avoid panic because of extra bits set.
PR: kern/102211
Submitted by: yoichi
Diffstat (limited to 'sys/dev/ata')
-rw-r--r-- | sys/dev/ata/ata-raid.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/sys/dev/ata/ata-raid.c b/sys/dev/ata/ata-raid.c index 1e97607..a3b1e78 100644 --- a/sys/dev/ata/ata-raid.c +++ b/sys/dev/ata/ata-raid.c @@ -2544,22 +2544,24 @@ ata_raid_intel_read_meta(device_t dev, struct ar_softc **raidp) /* clear out any old info */ for (disk = 0; disk < raid->total_disks; disk++) { + u_int disk_idx = map->disk_idx[disk] & 0xffff; + raid->disks[disk].dev = NULL; - bcopy(meta->disk[map->disk_idx[disk]].serial, + bcopy(meta->disk[disk_idx].serial, raid->disks[disk].serial, sizeof(raid->disks[disk].serial)); raid->disks[disk].sectors = - meta->disk[map->disk_idx[disk]].sectors; + meta->disk[disk_idx].sectors; raid->disks[disk].flags = 0; - if (meta->disk[map->disk_idx[disk]].flags & INTEL_F_ONLINE) + if (meta->disk[disk_idx].flags & INTEL_F_ONLINE) raid->disks[disk].flags |= AR_DF_ONLINE; - if (meta->disk[map->disk_idx[disk]].flags & INTEL_F_ASSIGNED) + if (meta->disk[disk_idx].flags & INTEL_F_ASSIGNED) raid->disks[disk].flags |= AR_DF_ASSIGNED; - if (meta->disk[map->disk_idx[disk]].flags & INTEL_F_SPARE) { + if (meta->disk[disk_idx].flags & INTEL_F_SPARE) { raid->disks[disk].flags &= ~(AR_DF_ONLINE | AR_DF_ASSIGNED); raid->disks[disk].flags |= AR_DF_SPARE; } - if (meta->disk[map->disk_idx[disk]].flags & INTEL_F_DOWN) + if (meta->disk[disk_idx].flags & INTEL_F_DOWN) raid->disks[disk].flags &= ~AR_DF_ONLINE; } } |