[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <54B6C7E4.6010002@micron.com>
Date: Wed, 14 Jan 2015 11:47:48 -0800
From: Sam Bradshaw <sbradshaw@...ron.com>
To: <martin.petersen@...cle.com>, <axboe@...nel.dk>,
<linux-kernel@...r.kernel.org>
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@...ron.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;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists