]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
block: bvec_nr_vecs() returns value for wrong slab
authorGreg Edwards <gedwards@ddn.com>
Wed, 8 Aug 2018 19:27:53 +0000 (13:27 -0600)
committerJuerg Haefliger <juergh@canonical.com>
Wed, 24 Jul 2019 01:46:36 +0000 (19:46 -0600)
commitcf2a2e6a921c05ab0abdb1a51ef00c29e4b221ca
tree8266cf7a6de22823d3a5ed3237afa888c6686d7b
parenta7c8d9be473d3232a07a02946b1df60657cc6b91
block: bvec_nr_vecs() returns value for wrong slab

BugLink: https://bugs.launchpad.net/bugs/1835972
[ Upstream commit d6c02a9beb67f13d5f14f23e72fa9981e8b84477 ]

In commit ed996a52c868 ("block: simplify and cleanup bvec pool
handling"), the value of the slab index is incremented by one in
bvec_alloc() after the allocation is done to indicate an index value of
0 does not need to be later freed.

bvec_nr_vecs() was not updated accordingly, and thus returns the wrong
value.  Decrement idx before performing the lookup.

Fixes: ed996a52c868 ("block: simplify and cleanup bvec pool handling")
Signed-off-by: Greg Edwards <gedwards@ddn.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
block/bio.c