Report stripeoffset as zero not stripesize if physical block is zero

aligned, same as it is done for ATA.
This commit is contained in:
Alexander Motin 2011-12-23 20:59:13 +00:00
parent f0d6c5caf0
commit c8c8fe876f

View File

@ -2416,7 +2416,8 @@ dasetgeom(struct cam_periph *periph, uint32_t block_len, uint64_t maxsector,
dp->sectors = maxsector + 1; dp->sectors = maxsector + 1;
if (lbppbe > 0) { if (lbppbe > 0) {
dp->stripesize = block_len << lbppbe; dp->stripesize = block_len << lbppbe;
dp->stripeoffset = dp->stripesize - block_len * lalba; dp->stripeoffset = (dp->stripesize - block_len * lalba) %
dp->stripesize;
} else if (softc->quirks & DA_Q_4K) { } else if (softc->quirks & DA_Q_4K) {
dp->stripesize = 4096; dp->stripesize = 4096;
dp->stripeoffset = 0; dp->stripeoffset = 0;