Whamcloud - gitweb
LU-15160 kernel: kernel update SLES12 SP5 [4.12.14-122.91.2]
[fs/lustre-release.git] / lustre / kernel_patches / patches / fix-sd-dif-complete-rhel7.patch
1 When sector offset is larger then 2^32, the mapping from physical
2 reference tag to the virtual values expected by block layer will be
3 wrong.
4 Linux-commit: c611529e7cd3465ec0eada0f44200e8420c38908
5
6 Index: linux-3.10.0-693.21.1.el7.x86_64/drivers/scsi/sd_dif.c
7 ===================================================================
8 --- linux-3.10.0-693.21.1.el7.x86_64.orig/drivers/scsi/sd_dif.c
9 +++ linux-3.10.0-693.21.1.el7.x86_64/drivers/scsi/sd_dif.c
10 @@ -416,6 +416,7 @@ void sd_dif_complete(struct scsi_cmnd *s
11         struct sd_dif_tuple *sdt;
12         unsigned int i, j, sectors, sector_sz;
13         u32 phys, virt;
14 +       sector_t sector;
15  
16         sdkp = scsi_disk(scmd->request->rq_disk);
17  
18 @@ -425,9 +426,10 @@ void sd_dif_complete(struct scsi_cmnd *s
19         sector_sz = scmd->device->sector_size;
20         sectors = good_bytes / sector_sz;
21  
22 -       phys = blk_rq_pos(scmd->request) & 0xffffffff;
23 +       sector = blk_rq_pos(scmd->request);
24         if (sector_sz == 4096)
25 -               phys >>= 3;
26 +               sector >>= 3;
27 +       phys = sector & 0xffffffff;
28  
29         __rq_for_each_bio(bio, scmd->request) {
30                 struct bio_vec *iv;