diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2014-02-26 22:56:58 +0900 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2014-03-19 11:30:20 -0700 |
commit | c45eabec08776d462c34802d3e5bad295bda628e (patch) | |
tree | 61e57fe067407f86f23c4a9fca6abe9a2b605897 /drivers/scsi/scsi_debug.c | |
parent | 134997a041f70d4aa5434d2833c8a3cf33697899 (diff) |
[SCSI] scsi_debug: fix false positive logical block reference tag check 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>
Diffstat (limited to 'drivers/scsi/scsi_debug.c')
-rw-r--r-- | drivers/scsi/scsi_debug.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 2decc6417518..bdfb9be1ec75 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers/scsi/scsi_debug.c @@ -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; @@ -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); |