Messages in this thread Patch in this message | | | Date | Wed, 14 Jan 2015 11:47:48 -0800 | From | Sam Bradshaw <> | Subject | [PATCH] block: pass correct prot_buf pointer to integrity metadata processing function |
| |
The prot_buf pointer passed to the generate/verify functions is incorrect for the second and subsequent range, making it impossible to verify the guard tag. The patch correctly increments the prot_buf pointer by the tuple size for each pass.
Signed-off-by: Sam Bradshaw <sbradshaw@micron.com> --- diff --git a/block/bio-integrity.c b/block/bio-integrity.c index 5cbd5d9..c7cbf60 100644 --- a/block/bio-integrity.c +++ b/block/bio-integrity.c @@ -226,13 +226,13 @@ static int bio_integrity_process(struct bio *bio, iter.disk_name = bio->bi_bdev->bd_disk->disk_name; iter.interval = bi->interval; iter.seed = bip_get_seed(bip); - iter.prot_buf = prot_buf; bio_for_each_segment(bv, bio, bviter) { void *kaddr = kmap_atomic(bv.bv_page); iter.data_buf = kaddr + bv.bv_offset; iter.data_size = bv.bv_len; + iter.prot_buf = prot_buf; ret = proc_fn(&iter); if (ret) { @@ -241,6 +241,7 @@ static int bio_integrity_process(struct bio *bio, } kunmap_atomic(kaddr); + prot_buf += bi->tuple_size; } return ret; }
| |