Skip to content

Commit

Permalink
dm raid1: fix immutable biovec related BUG when retrying read bio
Browse files Browse the repository at this point in the history
When restoring bi_end_io, increase bi_remaining before retrying the bio
to avoid BUG_ON(atomic_read(&bio->bi_remaining) <= 0) in bio_endio().

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
  • Loading branch information
Mikulas Patocka authored and Mike Snitzer committed Feb 18, 2014
1 parent d73f990 commit f3a44fe
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/md/dm-raid1.c
Original file line number Diff line number Diff line change
Expand Up @@ -1244,6 +1244,9 @@ static int mirror_end_io(struct dm_target *ti, struct bio *bio, int error)

dm_bio_restore(bd, bio);
bio_record->details.bi_bdev = NULL;

atomic_inc(&bio->bi_remaining);

queue_bio(ms, bio, rw);
return DM_ENDIO_INCOMPLETE;
}
Expand Down

0 comments on commit f3a44fe

Please sign in to comment.