summaryrefslogtreecommitdiff
path: root/drivers/scsi
diff options
context:
space:
mode:
authorAnuj Gupta <anuj20.g@samsung.com>2025-06-30 14:35:46 +0530
committerChristian Brauner <brauner@kernel.org>2025-07-01 14:00:15 +0200
commit76e45252a4cefa205439eb6610a244771e7d88da (patch)
tree939648040edf317190ebf7fb581104f94b2aa618 /drivers/scsi
parentc6603b1d6556cc02d0169f74508ab0e3e3e4bd76 (diff)
downloadlinux-next-76e45252a4cefa205439eb6610a244771e7d88da.tar.gz
linux-next-76e45252a4cefa205439eb6610a244771e7d88da.zip
block: introduce pi_tuple_size field in blk_integrity
Introduce a new pi_tuple_size field in struct blk_integrity to explicitly represent the size (in bytes) of the protection information (PI) tuple. This is a prep patch. Add validation in blk_validate_integrity_limits() to ensure that pi size matches the expected size for known checksum types and never exceeds the pi_tuple_size. Suggested-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Anuj Gupta <anuj20.g@samsung.com> Link: https://lore.kernel.org/20250630090548.3317-3-anuj20.g@samsung.com Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/sd_dif.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/scsi/sd_dif.c b/drivers/scsi/sd_dif.c
index 18bfca1f1c78..ff4217fef93b 100644
--- a/drivers/scsi/sd_dif.c
+++ b/drivers/scsi/sd_dif.c
@@ -53,6 +53,7 @@ void sd_dif_config_host(struct scsi_disk *sdkp, struct queue_limits *lim)
bi->flags |= BLK_INTEGRITY_REF_TAG;
bi->metadata_size = sizeof(struct t10_pi_tuple);
+ bi->pi_tuple_size = bi->metadata_size;
if (dif && type) {
bi->flags |= BLK_INTEGRITY_DEVICE_CAPABLE;