summaryrefslogtreecommitdiff
path: root/fs/bio-integrity.c
diff options
context:
space:
mode:
authorNicholas Bellinger <nab@linux-iscsi.org>2014-01-21 20:32:05 -0800
committerJiri Slaby <jslaby@suse.cz>2014-03-24 09:45:06 +0100
commit7cbcb219e4113e10ce4b036118992abdbc4a8273 (patch)
treec81b79996f542147483b65c609d520095e146f58 /fs/bio-integrity.c
parentcf9fca41e523e859aadb6ae78a9502662f9fc7a1 (diff)
bio-integrity: Fix bio_integrity_verify segment start bug
commit 5837c80e870bc3b12ac6a98cdc9ce7a9522a8fb6 upstream. This patch addresses a bug in bio_integrity_verify() code that has been causing DIF READ verify operations to be silently skipped. The issue is that bio->bi_idx will have been incremented within bio_advance() code in the normal blk_update_request() -> req_bio_endio() completion path, and bio_integrity_verify() is using bio_for_each_segment() which starts the bio segment walk at the current bio->bi_idx. So instead use bio_for_each_segment_all() to always start the bio segment walk from zero, regardless of the current bio->bi_idx value after bio_advance() has been called. (Context change for v3.10.y -> v3.13.y code - nab) Cc: Martin K. Petersen <martin.petersen@oracle.com> Cc: Jens Axboe <axboe@kernel.dk> Cc: Christoph Hellwig <hch@lst.de> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org> Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Diffstat (limited to 'fs/bio-integrity.c')
-rw-r--r--fs/bio-integrity.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/bio-integrity.c b/fs/bio-integrity.c
index 76273c1d26a6..b5ee393e2e8d 100644
--- a/fs/bio-integrity.c
+++ b/fs/bio-integrity.c
@@ -316,7 +316,7 @@ static void bio_integrity_generate(struct bio *bio)
bix.disk_name = bio->bi_bdev->bd_disk->disk_name;
bix.sector_size = bi->sector_size;
- bio_for_each_segment(bv, bio, i) {
+ bio_for_each_segment_all(bv, bio, i) {
void *kaddr = kmap_atomic(bv->bv_page);
bix.data_buf = kaddr + bv->bv_offset;
bix.data_size = bv->bv_len;