提交 c45eabec 编写于 作者: A Akinobu Mita 提交者: James Bottomley

[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: NAkinobu Mita <akinobu.mita@gmail.com>
Acked-by: NMartin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: NDouglas Gilbert <dgilbert@interlog.com>
Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
上级 134997a0
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册