Commit eec70897 authored by Nicholas Bellinger's avatar Nicholas Bellinger Committed by Jens Axboe

bio-integrity: Drop bio_integrity_verify BUG_ON in post bip->bip_iter world

Given that bip->bip_iter.bi_size is decremented after bio_advance() ->
bio_integrity_advance() is called, the BUG_ON() in bio_integrity_verify()
ends up tripping in v3.14-rc1 code with the advent of immutable biovecs
in:

commit d57a5f7c
Author: Kent Overstreet <kmo@daterainc.com>
Date:   Sat Nov 23 17:20:16 2013 -0800

    bio-integrity: Convert to bvec_iter

Given that there is no easy way to ascertain the original bi_size
value, go ahead and drop this BUG_ON().
Reported-by: default avatarSagi Grimberg <sagig@dev.mellanox.co.il>
Reported-by: default avatarAkinobu Mita <akinobu.mita@gmail.com>
Acked-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Cc: Kent Overstreet <kmo@daterainc.com>
Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent d6a25b31
...@@ -458,11 +458,10 @@ static int bio_integrity_verify(struct bio *bio) ...@@ -458,11 +458,10 @@ static int bio_integrity_verify(struct bio *bio)
struct blk_integrity_exchg bix; struct blk_integrity_exchg bix;
struct bio_vec *bv; struct bio_vec *bv;
sector_t sector = bio->bi_integrity->bip_iter.bi_sector; sector_t sector = bio->bi_integrity->bip_iter.bi_sector;
unsigned int sectors, total, ret; unsigned int sectors, ret = 0;
void *prot_buf = bio->bi_integrity->bip_buf; void *prot_buf = bio->bi_integrity->bip_buf;
int i; int i;
ret = total = 0;
bix.disk_name = bio->bi_bdev->bd_disk->disk_name; bix.disk_name = bio->bi_bdev->bd_disk->disk_name;
bix.sector_size = bi->sector_size; bix.sector_size = bi->sector_size;
...@@ -484,8 +483,6 @@ static int bio_integrity_verify(struct bio *bio) ...@@ -484,8 +483,6 @@ static int bio_integrity_verify(struct bio *bio)
sectors = bv->bv_len / bi->sector_size; sectors = bv->bv_len / bi->sector_size;
sector += sectors; sector += sectors;
prot_buf += sectors * bi->tuple_size; prot_buf += sectors * bi->tuple_size;
total += sectors * bi->tuple_size;
BUG_ON(total > bio->bi_integrity->bip_iter.bi_size);
kunmap_atomic(kaddr); kunmap_atomic(kaddr);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment