* [PATCH] scsi_debug: fix false positive logical block reference tag check fail
@ 2013-12-09 13:54 Akinobu Mita
2013-12-09 13:54 ` [PATCH] scsi_debug: make pseudo_primary static Akinobu Mita
0 siblings, 1 reply; 2+ messages in thread
From: Akinobu Mita @ 2013-12-09 13:54 UTC (permalink / raw)
To: linux-scsi
Cc: Akinobu Mita, Douglas Gilbert, Martin K. Petersen,
James Bottomley
Reading partially unwritten sectors generates false positive logical
block reference tag check failure.
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>
Cc: Douglas Gilbert <dgilbert@interlog.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: James Bottomley <JBottomley@Parallels.com>
Cc: linux-scsi@vger.kernel.org
---
drivers/scsi/scsi_debug.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index 2decc64..bdfb9be 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);
--
1.8.3.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] scsi_debug: make pseudo_primary static
2013-12-09 13:54 [PATCH] scsi_debug: fix false positive logical block reference tag check fail Akinobu Mita
@ 2013-12-09 13:54 ` Akinobu Mita
0 siblings, 0 replies; 2+ messages in thread
From: Akinobu Mita @ 2013-12-09 13:54 UTC (permalink / raw)
To: linux-scsi; +Cc: Akinobu Mita, James E.J. Bottomley, Douglas Gilbert
It is not necessary to declare pseudo_primary as global, becuase it
is only used in scsi_debug.c.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: "James E.J. Bottomley" <JBottomley@parallels.com>
Cc: Douglas Gilbert <dgilbert@interlog.com>
Cc: linux-scsi@vger.kernel.org
---
drivers/scsi/scsi_debug.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index bdfb9be..9cd211e 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -3246,7 +3246,7 @@ static struct attribute *sdebug_drv_attrs[] = {
};
ATTRIBUTE_GROUPS(sdebug_drv);
-struct device *pseudo_primary;
+static struct device *pseudo_primary;
static int __init scsi_debug_init(void)
{
--
1.8.3.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-12-09 13:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-09 13:54 [PATCH] scsi_debug: fix false positive logical block reference tag check fail Akinobu Mita
2013-12-09 13:54 ` [PATCH] scsi_debug: make pseudo_primary static Akinobu Mita
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).