Permalink
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 <rlaager@wiktel.com>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Signed-off-by: Garrett Fields <ghfields@gmail.com>
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/zfs.in
@@ -900,7 +900,7 @@ mountroot()
}' |
while read i
do
if [ -e "/sys/block/$i/queue/scheduler" ]
if grep -sq noop /sys/block/$i/queue/scheduler
then
echo noop > "/sys/block/$i/queue/scheduler"
fi

0 comments on commit 5b3bfd8

Please sign in to comment.