public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] block: fix integrity offset/length conversions
@ 2026-04-03 19:41 Caleb Sander Mateos
  2026-04-03 19:41 ` [PATCH 1/6] blk-integrity: take sector_t in bio_integrity_intervals() Caleb Sander Mateos
                   ` (6 more replies)
  0 siblings, 7 replies; 20+ messages in thread
From: Caleb Sander Mateos @ 2026-04-03 19:41 UTC (permalink / raw)
  To: Jens Axboe, Christoph Hellwig, Sagi Grimberg, Chaitanya Kulkarni,
	Martin K. Petersen
  Cc: linux-block, linux-kernel, linux-nvme, linux-scsi, target-devel,
	Caleb Sander Mateos

The block layer's integrity code currently sets the seed (initial
reference tag) in units of 512-byte sectors but increments it in units
of integrity intervals. Not only do the T10 DIF formats require ref tags
to be the lower bits of the logical block address, but mixing the two
units means the ref tags used for a particular logical block vary based
on its offset within a read/write request. This looks to be a
longstanding bug affecting block devices that support integrity with
block sizes > 512 bytes; I'm surprised it wasn't noticed before.

Also fix the newly added fs_bio_integrity_verify() to pass
bio_integrity_verify() a struct bdev_iter representing the data instead
of the integrity. Most of the integrity data is currently being skipped.

Caleb Sander Mateos (6):
  blk-integrity: take sector_t in bio_integrity_intervals()
  block: use integrity interval instead of sector as seed
  bio-integrity-fs: pass data iter to bio_integrity_verify()
  bio-integrity-fs: use integrity interval instead of sector as seed
  t10-pi: use bio_integrity_intervals() helper
  target: use bio_integrity_intervals() helper

 block/bio-integrity-fs.c            |  5 +++--
 block/bio-integrity.c               |  2 +-
 block/t10-pi.c                      |  4 ++--
 drivers/nvme/target/io-cmd-bdev.c   |  3 +--
 drivers/target/target_core_iblock.c |  3 +--
 include/linux/blk-integrity.h       | 12 ++++++------
 6 files changed, 14 insertions(+), 15 deletions(-)

-- 
2.45.2


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

end of thread, other threads:[~2026-04-07 16:49 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-03 19:41 [PATCH 0/6] block: fix integrity offset/length conversions Caleb Sander Mateos
2026-04-03 19:41 ` [PATCH 1/6] blk-integrity: take sector_t in bio_integrity_intervals() Caleb Sander Mateos
2026-04-05 11:27   ` Anuj gupta
2026-04-06  6:31   ` Christoph Hellwig
2026-04-03 19:41 ` [PATCH 2/6] block: use integrity interval instead of sector as seed Caleb Sander Mateos
2026-04-05 11:27   ` Anuj gupta
2026-04-06  6:34   ` Christoph Hellwig
2026-04-07 16:48     ` Caleb Sander Mateos
2026-04-03 19:41 ` [PATCH 3/6] bio-integrity-fs: pass data iter to bio_integrity_verify() Caleb Sander Mateos
2026-04-05 11:28   ` Anuj gupta
2026-04-06  6:35   ` Christoph Hellwig
2026-04-03 19:41 ` [PATCH 4/6] bio-integrity-fs: use integrity interval instead of sector as seed Caleb Sander Mateos
2026-04-05 11:29   ` Anuj gupta
2026-04-06  6:36   ` Christoph Hellwig
2026-04-03 19:41 ` [PATCH 5/6] t10-pi: use bio_integrity_intervals() helper Caleb Sander Mateos
2026-04-05 23:43   ` Anuj gupta
2026-04-06  6:36   ` Christoph Hellwig
2026-04-03 19:41 ` [PATCH 6/6] target: " Caleb Sander Mateos
2026-04-05 11:29   ` Anuj gupta
2026-04-05 11:26 ` [PATCH 0/6] block: fix integrity offset/length conversions Anuj gupta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox