]> git.baikalelectronics.ru Git - kernel.git/commit
block: don't use for-inside-for in bio_for_each_segment_all
authorMing Lei <ming.lei@redhat.com>
Mon, 8 Apr 2019 11:02:38 +0000 (19:02 +0800)
committerJens Axboe <axboe@kernel.dk>
Mon, 8 Apr 2019 14:19:41 +0000 (08:19 -0600)
commit77ded6e3dafdf4447c61bcdb4f40f1077006e961
treec46db66fbb2979d69b7fe6ad6f9065ff9312e0a5
parent71ed5bcfd45ab35e5abdfc66d15f941b2df98047
block: don't use for-inside-for in bio_for_each_segment_all

Commit b3e229b9d9ee ("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: Johannes Thumshirn <jthumshirn@suse.de>
Reported-and-Tested-by: Qu Wenruo <quwenruo.btrfs@gmx.com>
Fixes: b3e229b9d9ee ("block: allow bio_for_each_segment_all() to iterate over multi-page bvec")
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
include/linux/bio.h
include/linux/bvec.h