]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.11-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 2 Oct 2024 15:46:26 +0000 (17:46 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 2 Oct 2024 15:46:26 +0000 (17:46 +0200)
added patches:
block-fix-elv_iosched_local_module-handling-of-none-scheduler.patch

queue-6.11/block-fix-elv_iosched_local_module-handling-of-none-scheduler.patch [new file with mode: 0644]
queue-6.11/series

diff --git a/queue-6.11/block-fix-elv_iosched_local_module-handling-of-none-scheduler.patch b/queue-6.11/block-fix-elv_iosched_local_module-handling-of-none-scheduler.patch
new file mode 100644 (file)
index 0000000..12de6b8
--- /dev/null
@@ -0,0 +1,47 @@
+From e3accac1a976e65491a9b9fba82ce8ddbd3d2389 Mon Sep 17 00:00:00 2001
+From: Damien Le Moal <dlemoal@kernel.org>
+Date: Tue, 17 Sep 2024 22:32:31 +0900
+Subject: block: Fix elv_iosched_local_module handling of "none" scheduler
+
+From: Damien Le Moal <dlemoal@kernel.org>
+
+commit e3accac1a976e65491a9b9fba82ce8ddbd3d2389 upstream.
+
+Commit 734e1a860312 ("block: Prevent deadlocks when switching
+elevators") introduced the function elv_iosched_load_module() to allow
+loading an elevator module outside of elv_iosched_store() with the
+target device queue not frozen, to avoid deadlocks. However, the "none"
+scheduler does not have a module and as a result,
+elv_iosched_load_module() always returns an error when trying to switch
+to this valid scheduler.
+
+Fix this by ignoring the return value of the request_module() call
+done by elv_iosched_load_module(). This restores the behavior before
+commit 734e1a860312, which was to ignore the request_module() result and
+instead rely on elevator_change() to handle the "none" scheduler case.
+
+Reported-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
+Fixes: 734e1a860312 ("block: Prevent deadlocks when switching elevators")
+Cc: stable@vger.kernel.org
+Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
+Reviewed-by: Christoph Hellwig <hch@lst.de>
+Link: https://lore.kernel.org/r/20240917133231.134806-1-dlemoal@kernel.org
+Signed-off-by: Jens Axboe <axboe@kernel.dk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ block/elevator.c |    4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/block/elevator.c
++++ b/block/elevator.c
+@@ -715,7 +715,9 @@ int elv_iosched_load_module(struct gendi
+       strscpy(elevator_name, buf, sizeof(elevator_name));
+-      return request_module("%s-iosched", strstrip(elevator_name));
++      request_module("%s-iosched", strstrip(elevator_name));
++
++      return 0;
+ }
+ ssize_t elv_iosched_store(struct gendisk *disk, const char *buf,
index 181702f5200726d8096beff4a3cabf6e61baf31e..3cd041ff812cc245aff54e308700c4dbee11f345 100644 (file)
@@ -693,3 +693,4 @@ i2c-isch-add-missed-else.patch
 i2c-xiic-try-re-initialization-on-bus-busy-timeout.patch
 documentation-kvm-fix-warning-in-make-htmldocs.patch
 bpf-fix-use-after-free-in-bpf_uprobe_multi_link_attach.patch
+block-fix-elv_iosched_local_module-handling-of-none-scheduler.patch