summaryrefslogtreecommitdiff
path: root/block/bio-integrity.c
diff options
context:
space:
mode:
authorKanchan Joshi <joshi.k@samsung.com>2024-02-01 16:01:25 +0300
committerJens Axboe <axboe@kernel.dk>2024-02-12 18:49:31 +0300
commit60d21aac52e26531affdadb7543fe5b93f58b450 (patch)
tree0048ce8335e980a0f9d899fe61cbbb90c5ec713f /block/bio-integrity.c
parent6b5c132a3f0d3b7c024ae98f0ace07c04d32cf73 (diff)
downloadlinux-60d21aac52e26531affdadb7543fe5b93f58b450.tar.xz
block: support PI at non-zero offset within metadata
Block layer integrity processing assumes that protection information (PI) is placed in the first bytes of each metadata block. Remove this limitation and include the metadata before the PI in the calculation of the guard tag. Signed-off-by: Kanchan Joshi <joshi.k@samsung.com> Signed-off-by: Chinmay Gameti <c.gameti@samsung.com> Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Link: https://lore.kernel.org/r/20240201130126.211402-3-joshi.k@samsung.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/bio-integrity.c')
-rw-r--r--block/bio-integrity.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/block/bio-integrity.c b/block/bio-integrity.c
index c9a16fba58b9..2e3e8e04961e 100644
--- a/block/bio-integrity.c
+++ b/block/bio-integrity.c
@@ -395,6 +395,7 @@ static blk_status_t bio_integrity_process(struct bio *bio,
iter.tuple_size = bi->tuple_size;
iter.seed = proc_iter->bi_sector;
iter.prot_buf = bvec_virt(bip->bip_vec);
+ iter.pi_offset = bi->pi_offset;
__bio_for_each_segment(bv, bio, bviter, *proc_iter) {
void *kaddr = bvec_kmap_local(&bv);