From: Garrett Fields Date: Wed, 10 Oct 2018 15:46:22 +0000 (-0400) Subject: Check scheduler for "noop" before setting "noop" X-Git-Tag: zfs-0.8.0-rc2~65 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5b3bfd86a4acd0fd572802de6eb8bfed322dd470;p=zfs 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 --- diff --git a/contrib/initramfs/scripts/zfs.in b/contrib/initramfs/scripts/zfs.in index c0755a371..18c8ca2ad 100644 --- a/contrib/initramfs/scripts/zfs.in +++ b/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