bvec/iter: disallow zero-length segment bvecs
zero-length bvec segments are allowed in general, but not handled by bio and down the block layer so filtered out. This inconsistency may be confusing and prevent from optimisations. As zero-length segments are useless and places that were generating them are patched, declare them not allowed. Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Reviewed-by: Ming Lei <ming.lei@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk> (cherry picked from commit 9b2e0016d04c6542ace0128eb82ecb3b10c97e43) (cherry picked from commit 87afbd40acbb99860f846ad6f199e62e93be96c2) (cherry picked from commit f0677085687d50b5ecd6e7a2e19e4aff23251cb6) (cherry picked from commit affb154c088db678d4a541f8a4080fa5088cb10b) (cherry picked from commit 9b383b80e8432af1d0421acf9287076db26996d7) (cherry picked from commit f643066fcac50220888ecfe9b86c5d895d621648) (cherry picked from commit d2f588cf9664d76f78287142f505e4f375503ae6)
This commit is contained in:
parent
8ae63d0654
commit
3c61c6aa45
3 changed files with 10 additions and 2 deletions
|
@ -40,6 +40,8 @@ normal code doesn't have to deal with bi_bvec_done.
|
|||
There is a lower level advance function - bvec_iter_advance() - which takes
|
||||
a pointer to a biovec, not a bio; this is used by the bio integrity code.
|
||||
|
||||
As of 5.12 bvec segments with zero bv_len are not supported.
|
||||
|
||||
What's all this get us?
|
||||
=======================
|
||||
|
||||
|
|
|
@ -866,6 +866,14 @@ no matter what. Everything is handled by the caller.
|
|||
clone_private_mount() returns a longterm mount now, so the proper destructor of
|
||||
its result is kern_unmount() or kern_unmount_array().
|
||||
|
||||
|
||||
---
|
||||
|
||||
**mandatory**
|
||||
|
||||
zero-length bvec segments are disallowed, they must be filtered out before
|
||||
passed on to an iterator.
|
||||
|
||||
---
|
||||
|
||||
**mandatory**
|
||||
|
|
|
@ -72,8 +72,6 @@
|
|||
__start.bi_bvec_done = skip; \
|
||||
__start.bi_idx = 0; \
|
||||
for_each_bvec(__v, i->bvec, __bi, __start) { \
|
||||
if (!__v.bv_len) \
|
||||
continue; \
|
||||
(void)(STEP); \
|
||||
} \
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue