Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Thumshirn <jthumshirn@suse.de>2018-10-15 13:26:20 +0200
committerJohannes Thumshirn <jthumshirn@suse.de>2018-10-15 13:26:20 +0200
commit0a7a1e147726c66785a92c01b557144313cc79c7 (patch)
tree0f38657e72847862f69ca9851686769dcdedbab7
parent92a82295b3f808ec97372eb0fad9e54942fac571 (diff)
block: bvec_nr_vecs() returns value for wrong slab
(bsc#1111834).
-rw-r--r--patches.fixes/block-bvec_nr_vecs-returns-value-for-wrong-slab.patch37
-rw-r--r--series.conf1
2 files changed, 38 insertions, 0 deletions
diff --git a/patches.fixes/block-bvec_nr_vecs-returns-value-for-wrong-slab.patch b/patches.fixes/block-bvec_nr_vecs-returns-value-for-wrong-slab.patch
new file mode 100644
index 0000000000..bab14b368e
--- /dev/null
+++ b/patches.fixes/block-bvec_nr_vecs-returns-value-for-wrong-slab.patch
@@ -0,0 +1,37 @@
+From: Greg Edwards <gedwards@ddn.com>
+Date: Wed, 8 Aug 2018 13:27:53 -0600
+Subject: block: bvec_nr_vecs() returns value for wrong slab
+Git-commit: d6c02a9beb67f13d5f14f23e72fa9981e8b84477
+Patch-mainline: v4.19-rc1
+References: bsc#1111834
+
+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>
+Acked-by: Johannes Thumshirn <jthumshirn@suse.de>
+---
+ block/bio.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/block/bio.c b/block/bio.c
+index b832151cd0bf..04969b392c72 100644
+--- a/block/bio.c
++++ b/block/bio.c
+@@ -158,7 +158,7 @@ static void bio_put_slab(struct bio_set *bs)
+
+ unsigned int bvec_nr_vecs(unsigned short idx)
+ {
+- return bvec_slabs[idx].nr_vecs;
++ return bvec_slabs[--idx].nr_vecs;
+ }
+
+ void bvec_free(mempool_t *pool, struct bio_vec *bv, unsigned int idx)
+
diff --git a/series.conf b/series.conf
index 41cfcc0920..80dabffe22 100644
--- a/series.conf
+++ b/series.conf
@@ -17101,6 +17101,7 @@
patches.suse/0237-bcache-make-the-pr_err-statement-used-for-ENOENT-onl.patch
patches.fixes/nvme-fixup-crash-on-failed-discovery.patch
patches.fixes/nvme.h-fixup-ANA-group-descriptor-format.patch
+ patches.fixes/block-bvec_nr_vecs-returns-value-for-wrong-slab.patch
patches.suse/0236-bcache-fix-error-setting-writeback_rate-through-sysf.patch
patches.suse/0001-md-cluster-clear-another-node-s-suspend_area-after-t.patch
patches.suse/0002-md-cluster-show-array-s-status-more-accurate.patch