lkml.org 
[lkml]   [2015]   [Jan]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
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;
}

\
 
 \ /
  Last update: 2015-01-14 21:01    [W:1.197 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site