]> git.baikalelectronics.ru Git - 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)
committerJens Axboe <axboe@kernel.dk>
Thu, 9 Aug 2018 14:25:04 +0000 (08:25 -0600)
commitfa4a01b60c88911b80c14f10ed53dc2efdba7799
treecc921bc4fba16e9fc8e072f7d9d112bba6e3162e
parent0ea7e408b3a1a733c3984eb81900d3d9769dc0e8
block: bvec_nr_vecs() returns value for wrong slab

In commit 0be087480a17 ("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: 0be087480a17 ("block: simplify and cleanup bvec pool handling")
Signed-off-by: Greg Edwards <gedwards@ddn.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/bio.c