Skip to content

Commit

Permalink
bio-integrity: Drop bio_integrity_verify BUG_ON in post bip->bip_iter…
Browse files Browse the repository at this point in the history
… 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 d57a5f7
Author: Kent Overstreet <[email protected]>
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: Sagi Grimberg <[email protected]>
Reported-by: Akinobu Mita <[email protected]>
Acked-by: Martin K. Petersen <[email protected]>
Cc: Kent Overstreet <[email protected]>
Signed-off-by: Nicholas Bellinger <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Nicholas Bellinger authored and axboe committed Feb 21, 2014
1 parent d6a25b3 commit eec7089
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions fs/bio-integrity.c
Original file line number Diff line number Diff line change
Expand Up @@ -458,11 +458,10 @@ static int bio_integrity_verify(struct bio *bio)
struct blk_integrity_exchg bix;
struct bio_vec *bv;
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;
int i;

ret = total = 0;
bix.disk_name = bio->bi_bdev->bd_disk->disk_name;
bix.sector_size = bi->sector_size;

Expand All @@ -484,8 +483,6 @@ static int bio_integrity_verify(struct bio *bio)
sectors = bv->bv_len / bi->sector_size;
sector += sectors;
prot_buf += sectors * bi->tuple_size;
total += sectors * bi->tuple_size;
BUG_ON(total > bio->bi_integrity->bip_iter.bi_size);

kunmap_atomic(kaddr);
}
Expand Down

0 comments on commit eec7089

Please sign in to comment.