block: Fix elv_iosched_local_module handling of "none" scheduler

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Damien Le Moal <dlemoal@xxxxxxxxxx>

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@xxxxxxx>
Fixes: 734e1a860312 ("block: Prevent deadlocks when switching elevators")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Damien Le Moal <dlemoal@xxxxxxxxxx>
Reviewed-by: Christoph Hellwig <hch@xxxxxx>
Link: https://lore.kernel.org/r/20240917133231.134806-1-dlemoal@xxxxxxxxxx
Signed-off-by: Jens Axboe <axboe@xxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 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,


Patches currently in stable-queue which might be from dlemoal@xxxxxxxxxx are

queue-6.11/nbd-correct-the-maximum-value-for-discard-sectors.patch
queue-6.11/reset-k210-fix-of-node-leak-in-probe-error-path.patch
queue-6.11/reset-berlin-fix-of-node-leak-in-probe-error-path.patch
queue-6.11/ata-libata-scsi-fix-ata_msense_control-cdl-page-reporting.patch
queue-6.11/ublk-move-zone-report-data-out-of-request-pdu.patch
queue-6.11/block-fix-elv_iosched_local_module-handling-of-none-scheduler.patch
queue-6.11/ata-libata-clear-did_time_out-for-ata-pt-commands-wi.patch
queue-6.11/f2fs-check-discard-support-for-conventional-zones.patch




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux