* [PATCH] scsi_debug: write_same: fix error report
@ 2017-10-29 14:47 Douglas Gilbert
2017-10-31 12:31 ` Martin K. Petersen
0 siblings, 1 reply; 2+ messages in thread
From: Douglas Gilbert @ 2017-10-29 14:47 UTC (permalink / raw)
To: linux-scsi; +Cc: martin.petersen, hare
The scsi_debug driver incorrectly suggests there is an error with
the SCSI WRITE SAME command when the number_of_logical_blocks is
greater than 1. It will also suggest there is an error when NDOB
(no data-out buffer) is set and the number_of_logical_blocks is
greater than 0. Both are valid, fix.
Signed-off-by: Douglas Gilbert <dgilbert@interlog.com>
---
drivers/scsi/scsi_debug.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index 09ba494f8896..92bc5b2d24ae 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -3001,11 +3001,11 @@ static int resp_write_same(struct scsi_cmnd *scp, u64 lba, u32 num,
if (-1 == ret) {
write_unlock_irqrestore(&atomic_rw, iflags);
return DID_ERROR << 16;
- } else if (sdebug_verbose && (ret < (num * sdebug_sector_size)))
+ } else if (sdebug_verbose && !ndob && (ret < sdebug_sector_size))
sdev_printk(KERN_INFO, scp->device,
- "%s: %s: cdb indicated=%u, IO sent=%d bytes\n",
+ "%s: %s: lb size=%u, IO sent=%d bytes\n",
my_name, "write same",
- num * sdebug_sector_size, ret);
+ sdebug_sector_size, ret);
/* Copy first sector to remaining blocks */
for (i = 1 ; i < num ; i++)
--
2.14.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] scsi_debug: write_same: fix error report
2017-10-29 14:47 [PATCH] scsi_debug: write_same: fix error report Douglas Gilbert
@ 2017-10-31 12:31 ` Martin K. Petersen
0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2017-10-31 12:31 UTC (permalink / raw)
To: Douglas Gilbert; +Cc: linux-scsi, martin.petersen, hare
Doug,
> The scsi_debug driver incorrectly suggests there is an error with
> the SCSI WRITE SAME command when the number_of_logical_blocks is
> greater than 1. It will also suggest there is an error when NDOB
> (no data-out buffer) is set and the number_of_logical_blocks is
> greater than 0. Both are valid, fix.
Applied to 4.15/scsi-queue. Thanks!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-10-31 12:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-29 14:47 [PATCH] scsi_debug: write_same: fix error report Douglas Gilbert
2017-10-31 12:31 ` Martin K. Petersen
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.