All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] virtio_scsi pi_bytes{out,in} miscalculated on 4 KiB devices
@ 2018-07-25 14:22 Greg Edwards
  2018-07-25 14:22 ` [PATCH 1/2] block: move bio_integrity_{intervals,bytes} into blkdev.h Greg Edwards
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Greg Edwards @ 2018-07-25 14:22 UTC (permalink / raw)
  To: linux-block, linux-scsi; +Cc: Jens Axboe, Martin K. Petersen, Greg Edwards

When the VIRTIO_SCSI_F_T10_PI feature bit is enabled, the virtio_scsi driver
does not correctly calculate pi_bytes{out,in} when the underlying device has a
4 KiB logical block size.  The current code assumes a 512 byte logical block
size and protection interval exponent of 0 (512 bytes + 8 bytes PI).

The first patch moves bio_integrity_intervals() and bio_integrity_bytes() into
blkdev.h so drivers can make use of them.  The second patch modifies
virtio_scsi to call bio_integrity_bytes() to get the values for
pi_bytes{out,in}.

Greg Edwards (2):
  block: move bio_integrity_{intervals,bytes} into blkdev.h
  scsi: virtio_scsi: fix pi_bytes{out,in} on 4 KiB block size devices

 block/bio-integrity.c      | 22 ----------------------
 drivers/scsi/virtio_scsi.c |  8 ++++----
 include/linux/blkdev.h     | 34 ++++++++++++++++++++++++++++++++++
 3 files changed, 38 insertions(+), 26 deletions(-)

-- 
2.17.1

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-07-26 21:49 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-25 14:22 [PATCH 0/2] virtio_scsi pi_bytes{out,in} miscalculated on 4 KiB devices Greg Edwards
2018-07-25 14:22 ` [PATCH 1/2] block: move bio_integrity_{intervals,bytes} into blkdev.h Greg Edwards
2018-07-26  1:39   ` Martin K. Petersen
2018-07-25 14:22 ` [PATCH 2/2] scsi: virtio_scsi: fix pi_bytes{out,in} on 4 KiB block size devices Greg Edwards
2018-07-26  1:46   ` Martin K. Petersen
2018-07-26 19:52   ` [PATCH v2] " Greg Edwards
2018-07-26 21:49 ` [PATCH 0/2] virtio_scsi pi_bytes{out,in} miscalculated on 4 KiB devices Jens Axboe

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.