]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Oct 2022 14:56:11 +0000 (16:56 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Oct 2022 14:56:11 +0000 (16:56 +0200)
added patches:
blk-wbt-fix-that-rwb-wc-is-always-set-to-1-in-wbt_init.patch

queue-5.10/blk-wbt-fix-that-rwb-wc-is-always-set-to-1-in-wbt_init.patch [new file with mode: 0644]
queue-5.10/series

diff --git a/queue-5.10/blk-wbt-fix-that-rwb-wc-is-always-set-to-1-in-wbt_init.patch b/queue-5.10/blk-wbt-fix-that-rwb-wc-is-always-set-to-1-in-wbt_init.patch
new file mode 100644 (file)
index 0000000..9979fdd
--- /dev/null
@@ -0,0 +1,45 @@
+From 285febabac4a16655372d23ff43e89ff6f216691 Mon Sep 17 00:00:00 2001
+From: Yu Kuai <yukuai3@huawei.com>
+Date: Sun, 9 Oct 2022 18:10:38 +0800
+Subject: blk-wbt: fix that 'rwb->wc' is always set to 1 in wbt_init()
+
+From: Yu Kuai <yukuai3@huawei.com>
+
+commit 285febabac4a16655372d23ff43e89ff6f216691 upstream.
+
+commit 8c5035dfbb94 ("blk-wbt: call rq_qos_add() after wb_normal is
+initialized") moves wbt_set_write_cache() before rq_qos_add(), which
+is wrong because wbt_rq_qos() is still NULL.
+
+Fix the problem by removing wbt_set_write_cache() and setting 'rwb->wc'
+directly. Noted that this patch also remove the redundant setting of
+'rab->wc'.
+
+Fixes: 8c5035dfbb94 ("blk-wbt: call rq_qos_add() after wb_normal is initialized")
+Reported-by: kernel test robot <yujie.liu@intel.com>
+Link: https://lore.kernel.org/r/202210081045.77ddf59b-yujie.liu@intel.com
+Signed-off-by: Yu Kuai <yukuai3@huawei.com>
+Reviewed-by: Ming Lei <ming.lei@redhat.com>
+Link: https://lore.kernel.org/r/20221009101038.1692875-1-yukuai1@huaweicloud.com
+Signed-off-by: Jens Axboe <axboe@kernel.dk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ block/blk-wbt.c |    3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+--- a/block/blk-wbt.c
++++ b/block/blk-wbt.c
+@@ -838,12 +838,11 @@ int wbt_init(struct request_queue *q)
+       rwb->last_comp = rwb->last_issue = jiffies;
+       rwb->win_nsec = RWB_WINDOW_NSEC;
+       rwb->enable_state = WBT_STATE_ON_DEFAULT;
+-      rwb->wc = 1;
++      rwb->wc = test_bit(QUEUE_FLAG_WC, &q->queue_flags);
+       rwb->rq_depth.default_depth = RWB_DEF_DEPTH;
+       rwb->min_lat_nsec = wbt_default_latency_nsec(q);
+       wbt_queue_depth_changed(&rwb->rqos);
+-      wbt_set_write_cache(q, test_bit(QUEUE_FLAG_WC, &q->queue_flags));
+       /*
+        * Assign rwb and add the stats callback.
index 3875a63f4bee1da42c6c0559b6c7d7a50604c272..17725fd2c7f7fa3b9f37572de4169d5f07089abb 100644 (file)
@@ -75,3 +75,4 @@ acpi-video-force-backlight-native-for-more-tongfang-devices.patch
 x86-kconfig-drop-check-for-mabi-ms-for-config_efi_stub.patch
 makefile.debug-re-enable-debug-info-for-.s-files.patch
 mmc-core-add-sd-card-quirk-for-broken-discard.patch
+blk-wbt-fix-that-rwb-wc-is-always-set-to-1-in-wbt_init.patch