mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
elv_iosched_store(): fix strstrip() misuse
elv_iosched_store() ignore the return value of strstrip(). It makes small
inconsistent behavior.
This patch fixes it.
<before>
====================================
# cd /sys/block/{blockdev}/queue
case1:
# echo "anticipatory" > scheduler
# cat scheduler
noop [anticipatory] deadline cfq
case2:
# echo "anticipatory " > scheduler
# cat scheduler
noop [anticipatory] deadline cfq
case3:
# echo " anticipatory" > scheduler
bash: echo: write error: Invalid argument
<after>
====================================
# cd /sys/block/{blockdev}/queue
case1:
# echo "anticipatory" > scheduler
# cat scheduler
noop [anticipatory] deadline cfq
case2:
# echo "anticipatory " > scheduler
# cat scheduler
noop [anticipatory] deadline cfq
case3:
# echo " anticipatory" > scheduler
noop [anticipatory] deadline cfq
Cc: Li Zefan <[email protected]>
Cc: Jens Axboe <[email protected]>
Signed-off-by: KOSAKI Motohiro <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
parent
355b659c87
commit
8c27959858
1 changed files with 1 additions and 3 deletions
|
|
@ -1059,9 +1059,7 @@ ssize_t elv_iosched_store(struct request_queue *q, const char *name,
|
|||
return count;
|
||||
|
||||
strlcpy(elevator_name, name, sizeof(elevator_name));
|
||||
strstrip(elevator_name);
|
||||
|
||||
e = elevator_get(elevator_name);
|
||||
e = elevator_get(strstrip(elevator_name));
|
||||
if (!e) {
|
||||
printk(KERN_ERR "elevator: type %s not found\n", elevator_name);
|
||||
return -EINVAL;
|
||||
|
|
|
|||
Loading…
Reference in a new issue