]> www.infradead.org Git - users/jedix/linux-maple.git/commit
block: bio: introduce helpers to get the 1st and last bvec
authorMing Lei <ming.lei@canonical.com>
Fri, 26 Feb 2016 15:40:50 +0000 (23:40 +0800)
committerBrian Maly <brian.maly@oracle.com>
Mon, 23 Apr 2018 22:29:12 +0000 (18:29 -0400)
commitd9fe22e775031cf0b348978ec3c5329d96b31851
tree86c70be1f6d1fc61456739ce80d562575e0b3653
parent43e66cb6a09f5ded8092d9bd3a417db5ef785fc0
block: bio: introduce helpers to get the 1st and last bvec

The bio passed to bio_will_gap() may be fast cloned from upper
layer(dm, md, bcache, fs, ...), or from bio splitting in block
core.

Unfortunately bio_will_gap() just figures out the last bvec via
'bi_io_vec[prev->bi_vcnt - 1]' directly, and this way is obviously
wrong.

This patch introduces two helpers for getting the first and last
bvec of one bio for fixing the issue.

Cc: stable@vger.kernel.org
Reported-by: Sagi Grimberg <sagig@dev.mellanox.co.il>
Reviewed-by: Sagi Grimberg <sagig@mellanox.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ming Lei <ming.lei@canonical.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit 7bcd79ac50d9d83350a835bdb91c04ac9e098412)

Orabug: 27775588

Signed-off-by: Shan Hai <shan.hai@oracle.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
include/linux/bio.h