diff options
author | sos <sos@FreeBSD.org> | 2005-09-06 19:17:48 +0000 |
---|---|---|
committer | sos <sos@FreeBSD.org> | 2005-09-06 19:17:48 +0000 |
commit | a3b63345a1492651280e290af1213bb3bd49c124 (patch) | |
tree | 9d91f3e49f7d156cde6bf17d54cf70fb2f2fb2bf | |
parent | 535e8b6e003a1295c6c6d8a12660c68d9d2f61f3 (diff) | |
download | FreeBSD-src-a3b63345a1492651280e290af1213bb3bd49c124.zip FreeBSD-src-a3b63345a1492651280e290af1213bb3bd49c124.tar.gz |
Fix problem with finding the still working disk in a broken mirror on VIA.
-rw-r--r-- | sys/dev/ata/ata-raid.c | 2 | ||||
-rw-r--r-- | sys/dev/ata/ata-raid.h | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/sys/dev/ata/ata-raid.c b/sys/dev/ata/ata-raid.c index 046d6a1..f0b9eb8 100644 --- a/sys/dev/ata/ata-raid.c +++ b/sys/dev/ata/ata-raid.c @@ -3064,7 +3064,7 @@ ata_raid_via_read_meta(device_t dev, struct ar_softc **raidp) for (disk = 0; disk < 8; disk++) { if ((meta->disks[disk] == meta->disk_id) && - ((disk << 2) == meta->disk_index)) { + ((disk * sizeof(int32_t)) == (meta->disk_index & VIA_D_MASK))) { raid->disks[disk].dev = parent; raid->disks[disk].sectors = meta->total_sectors / raid->width; raid->disks[disk].flags = diff --git a/sys/dev/ata/ata-raid.h b/sys/dev/ata/ata-raid.h index 3fb959c..0d1cc38 100644 --- a/sys/dev/ata/ata-raid.h +++ b/sys/dev/ata/ata-raid.h @@ -711,6 +711,9 @@ struct via_raid_conf { #define VIA_T_SPAN 0x44 u_int8_t disk_index; +#define VIA_D_MASK 0x0f +#define VIA_D_DEGRADED 0x10 + u_int8_t stripe_layout; #define VIA_L_MASK 0x07 #define VIA_L_SHIFT 4 |