Browse files

Check scheduler for "noop" before setting "noop"

Originally code only checked for presence of "/sys/block/$i/queue/
scheduler".  "sh: write error: Invalid argument" was produced when
trying to set "noop" on certain devices (eg. virtio) when it isn't
a listed option. This modification continues to check for the presence
of "/sys/block/$i/queue/scheduler" and also checks that it contains
"noop" as an option before setting "noop".

Reviewed-by: Richard Laager <>
Reviewed-by: Tony Hutter <>
Reviewed-by: George Melikov <>
Reviewed-by: Richard Elling <>
Signed-off-by: Garrett Fields <>
Closes #8004
  • Loading branch information...
ghfields authored and behlendorf committed Oct 10, 2018
1 parent 2ef0f8c commit 5b3bfd86a4acd0fd572802de6eb8bfed322dd470
Showing with 1 addition and 1 deletion.
  1. +1 −1 contrib/initramfs/scripts/
@@ -900,7 +900,7 @@ mountroot()
}' |
while read i
if [ -e "/sys/block/$i/queue/scheduler" ]
if grep -sq noop /sys/block/$i/queue/scheduler
echo noop > "/sys/block/$i/queue/scheduler"

0 comments on commit 5b3bfd8

Please sign in to comment.