]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
SCSI: Fix two bugs in DIX retry handling
authorMartin K. Petersen <martin.petersen@oracle.com>
Wed, 13 Jun 2012 04:11:35 +0000 (00:11 -0400)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 13 Jun 2012 04:11:35 +0000 (00:11 -0400)
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>
drivers/scsi/sd_dif.c

index 1c47fa4ee1cfe98e34974b7f917cd93757fdf6cf..b8a00eeefb2065fc94632a379bdd5d95d1d6a7cd 100644 (file)
@@ -387,8 +387,10 @@ void sd_dif_prepare(struct request *rq, sector_t hw_sector,
                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;
 
@@ -408,7 +410,7 @@ void sd_dif_prepare(struct request *rq, sector_t hw_sector,
                        kunmap_atomic(sdt, KM_USER0);
                }
 
-               bio->bi_flags |= BIO_MAPPED_INTEGRITY;
+               bio->bi_flags |= (1 << BIO_MAPPED_INTEGRITY);
        }
 }