Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.dk/linux-block
Browse files Browse the repository at this point in the history
Pull block core regression fix from Jens Axboe:
 "Single fix for a regression introduced in this development cycle,
  where dm on top of dif/dix is broken.  From Darrick Wong"

* 'for-linus' of git://git.kernel.dk/linux-block:
  block: fix regression where bio_integrity_process uses wrong bio_vec iterator
  • Loading branch information
Linus Torvalds committed Dec 3, 2014
2 parents 46d967a + 594416a commit 93bd38b
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions block/bio-integrity.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,10 @@ static int bio_integrity_process(struct bio *bio,
{
struct blk_integrity *bi = bdev_get_integrity(bio->bi_bdev);
struct blk_integrity_iter iter;
struct bio_vec *bv;
struct bvec_iter bviter;
struct bio_vec bv;
struct bio_integrity_payload *bip = bio_integrity(bio);
unsigned int i, ret = 0;
unsigned int ret = 0;
void *prot_buf = page_address(bip->bip_vec->bv_page) +
bip->bip_vec->bv_offset;

Expand All @@ -227,11 +228,11 @@ static int bio_integrity_process(struct bio *bio,
iter.seed = bip_get_seed(bip);
iter.prot_buf = prot_buf;

bio_for_each_segment_all(bv, bio, i) {
void *kaddr = kmap_atomic(bv->bv_page);
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.data_buf = kaddr + bv.bv_offset;
iter.data_size = bv.bv_len;

ret = proc_fn(&iter);
if (ret) {
Expand Down

0 comments on commit 93bd38b

Please sign in to comment.