diff options
author | sos <sos@FreeBSD.org> | 2003-11-24 14:22:30 +0000 |
---|---|---|
committer | sos <sos@FreeBSD.org> | 2003-11-24 14:22:30 +0000 |
commit | fbc1154fb8c54d320b569336f2662334a1e3f8fc (patch) | |
tree | e0f492e7cdb42e15a74895f1d86cebb4b05ae9ce /sys/dev/ata | |
parent | dbb35f2dd342603882e54a666bb0da0d53013b62 (diff) | |
download | FreeBSD-src-fbc1154fb8c54d320b569336f2662334a1e3f8fc.zip FreeBSD-src-fbc1154fb8c54d320b569336f2662334a1e3f8fc.tar.gz |
Fix panic on certain failed configs.
Approved by: re@
Diffstat (limited to 'sys/dev/ata')
-rw-r--r-- | sys/dev/ata/ata-raid.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/sys/dev/ata/ata-raid.c b/sys/dev/ata/ata-raid.c index c424c7f..d541f0e 100644 --- a/sys/dev/ata/ata-raid.c +++ b/sys/dev/ata/ata-raid.c @@ -774,17 +774,24 @@ arstrategy(struct bio *bp) return; } if (bp->bio_cmd == BIO_READ) { + int src_online = + (rdp->disks[buf1->drive].flags & AR_DF_ONLINE); + int mir_online = + (rdp->disks[buf1->drive+rdp->width].flags & AR_DF_ONLINE); + /* if mirror gone or close to last access on source */ - if (!(rdp->disks[buf1->drive+rdp->width].flags & AR_DF_ONLINE)|| - (buf1->bp.bio_pblkno >= + if (!(mir_online) || + ((src_online) && + buf1->bp.bio_pblkno >= (rdp->disks[buf1->drive].last_lba - AR_PROXIMITY) && buf1->bp.bio_pblkno <= (rdp->disks[buf1->drive].last_lba + AR_PROXIMITY))) { rdp->flags &= ~AR_F_TOGGLE; } /* if source gone or close to last access on mirror */ - else if (!(rdp->disks[buf1->drive].flags & AR_DF_ONLINE) || - (buf1->bp.bio_pblkno >= + else if (!src_online) || + ((mir_online) && + buf1->bp.bio_pblkno >= (rdp->disks[buf1->drive + rdp->width].last_lba - AR_PROXIMITY) && buf1->bp.bio_pblkno <= |