From f4128931eb1f2d03a122998643dbfd1715a62d2d Mon Sep 17 00:00:00 2001 From: mav Date: Tue, 5 Jan 2010 13:58:18 +0000 Subject: [PATCH] MFC 200969: Report stripe size only if physical sector size is not equal to logical. --- sys/cam/ata/ata_da.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sys/cam/ata/ata_da.c b/sys/cam/ata/ata_da.c index f62af46d46b5..204efe24f99b 100644 --- a/sys/cam/ata/ata_da.c +++ b/sys/cam/ata/ata_da.c @@ -687,9 +687,14 @@ adaregister(struct cam_periph *periph, void *arg) softc->disk->d_sectorsize = softc->params.secsize; softc->disk->d_mediasize = (off_t)softc->params.sectors * softc->params.secsize; - softc->disk->d_stripesize = ata_physical_sector_size(&cgd->ident_data); - softc->disk->d_stripeoffset = softc->disk->d_stripesize - - ata_logical_sector_offset(&cgd->ident_data); + if (ata_physical_sector_size(&cgd->ident_data) != + softc->params.secsize) { + softc->disk->d_stripesize = + ata_physical_sector_size(&cgd->ident_data); + softc->disk->d_stripeoffset = (softc->disk->d_stripesize - + ata_logical_sector_offset(&cgd->ident_data)) % + softc->disk->d_stripesize; + } /* XXX: these are not actually "firmware" values, so they may be wrong */ softc->disk->d_fwsectors = softc->params.secs_per_track; softc->disk->d_fwheads = softc->params.heads;