1. When a bio has already been remapped skip it but advance the physical
sector count so subsequent bios get mapped correctly.
2. BIO_MAPPED_INTEGRITY was set incorrectly. Fixed upstream as part of
9354f1b8e.
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
struct bio_vec *iv;
/* Already remapped? */
- if (bio_flagged(bio, BIO_MAPPED_INTEGRITY))
- break;
+ if (bio_flagged(bio, BIO_MAPPED_INTEGRITY)) {
+ phys += bio_sectors(bio);
+ continue;
+ }
virt = bio->bi_integrity->bip_sector & 0xffffffff;
kunmap_atomic(sdt, KM_USER0);
}
- bio->bi_flags |= BIO_MAPPED_INTEGRITY;
+ bio->bi_flags |= (1 << BIO_MAPPED_INTEGRITY);
}
}