Skip to content
Commit 1200e07f authored by Ming Lei's avatar Ming Lei Committed by Jens Axboe
Browse files

block: don't use for-inside-for in bio_for_each_segment_all

Commit 6dc4f100

 ("block: allow bio_for_each_segment_all() to
iterate over multi-page bvec") changes bio_for_each_segment_all()
to use for-inside-for.

This way breaks all bio_for_each_segment_all() call with error out
branch via 'break', since now 'break' can only break from the inner
loop.

Fixes this issue by implementing bio_for_each_segment_all() via
single 'for' loop, and now the logic is very similar with normal
bvec iterator.

Cc: Qu Wenruo <quwenruo.btrfs@gmx.com>
Cc: linux-btrfs@vger.kernel.org
Cc: linux-fsdevel@vger.kernel.org
Cc: Omar Sandoval <osandov@fb.com>
Reviewed-by: default avatarJohannes Thumshirn <jthumshirn@suse.de>
Reported-and-Tested-by: default avatarQu Wenruo <quwenruo.btrfs@gmx.com>
Fixes: 6dc4f100

 ("block: allow bio_for_each_segment_all() to iterate over multi-page bvec")
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarMing Lei <ming.lei@redhat.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 15ade5d2
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