Skip to content

Commit

Permalink
[SCSI] scsi_debug: fix false positive logical block reference tag che…
Browse files Browse the repository at this point in the history
…ck fail

Reading partially unwritten sectors generates a false positive logical
block reference tag check failure when DIF is enabled.

This bug is caused by missing ei_lba increment in loop of dif_verify()
when unwritten sector is skipped.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Acked-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
  • Loading branch information
Akinobu Mita authored and James Bottomley committed Mar 19, 2014
1 parent 134997a commit c45eabe
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/scsi/scsi_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -1832,7 +1832,7 @@ static int prot_verify_read(struct scsi_cmnd *SCpnt, sector_t start_sec,
struct sd_dif_tuple *sdt;
sector_t sector;

for (i = 0; i < sectors; i++) {
for (i = 0; i < sectors; i++, ei_lba++) {
int ret;

sector = start_sec + i;
Expand All @@ -1846,8 +1846,6 @@ static int prot_verify_read(struct scsi_cmnd *SCpnt, sector_t start_sec,
dif_errors++;
return ret;
}

ei_lba++;
}

dif_copy_prot(SCpnt, start_sec, sectors, true);
Expand Down

0 comments on commit c45eabe

Please sign in to comment.