]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.1-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Jun 2023 09:47:04 +0000 (10:47 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Jun 2023 09:47:04 +0000 (10:47 +0100)
added patches:
block-fix-bio-cache-for-passthru-io.patch

queue-6.1/block-fix-bio-cache-for-passthru-io.patch [new file with mode: 0644]
queue-6.1/series

diff --git a/queue-6.1/block-fix-bio-cache-for-passthru-io.patch b/queue-6.1/block-fix-bio-cache-for-passthru-io.patch
new file mode 100644 (file)
index 0000000..210eb49
--- /dev/null
@@ -0,0 +1,42 @@
+From 46930b7cc7727271c9c27aac1fdc97a8645e2d00 Mon Sep 17 00:00:00 2001
+From: Anuj Gupta <anuj20.g@samsung.com>
+Date: Tue, 23 May 2023 16:47:09 +0530
+Subject: block: fix bio-cache for passthru IO
+
+From: Anuj Gupta <anuj20.g@samsung.com>
+
+commit 46930b7cc7727271c9c27aac1fdc97a8645e2d00 upstream.
+
+commit <8af870aa5b847> ("block: enable bio caching use for passthru IO")
+introduced bio-cache for passthru IO. In case when nr_vecs are greater
+than BIO_INLINE_VECS, bio and bvecs are allocated from mempool (instead
+of percpu cache) and REQ_ALLOC_CACHE is cleared. This causes the side
+effect of not freeing bio/bvecs into mempool on completion.
+
+This patch lets the passthru IO fallback to allocation using bio_kmalloc
+when nr_vecs are greater than BIO_INLINE_VECS. The corresponding bio
+is freed during call to blk_mq_map_bio_put during completion.
+
+Cc: stable@vger.kernel.org # 6.1
+fixes <8af870aa5b847> ("block: enable bio caching use for passthru IO")
+
+Signed-off-by: Anuj Gupta <anuj20.g@samsung.com>
+Signed-off-by: Kanchan Joshi <joshi.k@samsung.com>
+Link: https://lore.kernel.org/r/20230523111709.145676-1-anuj20.g@samsung.com
+Signed-off-by: Jens Axboe <axboe@kernel.dk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ block/blk-map.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/block/blk-map.c
++++ b/block/blk-map.c
+@@ -246,7 +246,7 @@ static struct bio *blk_rq_map_bio_alloc(
+ {
+       struct bio *bio;
+-      if (rq->cmd_flags & REQ_POLLED) {
++      if (rq->cmd_flags & REQ_POLLED && (nr_vecs <= BIO_INLINE_VECS)) {
+               blk_opf_t opf = rq->cmd_flags | REQ_ALLOC_CACHE;
+               bio = bio_alloc_bioset(NULL, nr_vecs, opf, gfp_mask,
index c42a7271679415725f11295c6b67a91297ab2b6d..c6d48d2c0d09f13e74acb2e9aa6824e528523b81 100644 (file)
@@ -35,3 +35,4 @@ octeontx2-af-add-validation-for-lmac-type.patch
 drm-amd-don-t-allow-s0ix-on-apus-older-than-raven.patch
 bluetooth-add-cmd-validity-checks-at-the-start-of-hci_sock_ioctl.patch
 revert-thermal-drivers-mellanox-use-generic-thermal_zone_get_trip-function.patch
+block-fix-bio-cache-for-passthru-io.patch