Commit d4634c58 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] dm: drop BIO_SEG_VALID bit

From: Joe Thornber <thornber@redhat.com>

I just noticed that bio_clone copies the BIO_SEG_VALID bit from the original
bio when it was set.  When we modify bi_idx or bi_vcnt afterwards the segment
counts are invalid and the bit must be dropped (though it is fairly unlikely
that it has already been set).  [Christophe Saout]
parent 01fce686
...@@ -338,6 +338,7 @@ static struct bio *clone_bio(struct bio *bio, sector_t sector, ...@@ -338,6 +338,7 @@ static struct bio *clone_bio(struct bio *bio, sector_t sector,
clone->bi_idx = idx; clone->bi_idx = idx;
clone->bi_vcnt = idx + bv_count; clone->bi_vcnt = idx + bv_count;
clone->bi_size = to_bytes(len); clone->bi_size = to_bytes(len);
clone->bi_flags &= ~(1 << BIO_SEG_VALID);
return clone; return clone;
} }
......
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