• KOSAKI Motohiro's avatar
    elv_iosched_store(): fix strstrip() misuse · 8c279598
    KOSAKI Motohiro authored
    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 <lizf@cn.fujitsu.com>
    Cc: Jens Axboe <jens.axboe@oracle.com>
    Signed-off-by: default avatarKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
    Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
    8c279598
elevator.c 24.4 KB