diff options
author | Ming Lei <ming.lei@redhat.com> | 2018-09-05 15:45:54 -0600 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2018-09-06 15:12:24 -0600 |
commit | 7759eb23fd9808a2e4498cf36a798ed65cde78ae (patch) | |
tree | 5ff1a0f21a48ee3f1c4eae4c2dbc7dd084e59792 /block/bio.c | |
parent | 3d0e63754fa47d65edff172c1156f44b6fca5ca1 (diff) | |
download | linux-7759eb23fd9808a2e4498cf36a798ed65cde78ae.tar.bz2 |
block: remove bio_rewind_iter()
It is pointed that bio_rewind_iter() is one very bad API[1]:
1) bio size may not be restored after rewinding
2) it causes some bogus change, such as 5151842b9d8732 (block: reset
bi_iter.bi_done after splitting bio)
3) rewinding really makes things complicated wrt. bio splitting
4) unnecessary updating of .bi_done in fast path
[1] https://marc.info/?t=153549924200005&r=1&w=2
So this patch takes Kent's suggestion to restore one bio into its original
state via saving bio iterator(struct bvec_iter) in bio_integrity_prep(),
given now bio_rewind_iter() is only used by bio integrity code.
Cc: Dmitry Monakhov <dmonakhov@openvz.org>
Cc: Hannes Reinecke <hare@suse.com>
Suggested-by: Kent Overstreet <kent.overstreet@gmail.com>
Acked-by: Kent Overstreet <kent.overstreet@gmail.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/bio.c')
-rw-r--r-- | block/bio.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/block/bio.c b/block/bio.c index 8c680a776171..f685e762809d 100644 --- a/block/bio.c +++ b/block/bio.c @@ -1807,7 +1807,6 @@ struct bio *bio_split(struct bio *bio, int sectors, bio_integrity_trim(split); bio_advance(bio, split->bi_iter.bi_size); - bio->bi_iter.bi_done = 0; if (bio_flagged(bio, BIO_TRACE_COMPLETION)) bio_set_flag(split, BIO_TRACE_COMPLETION); |