aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/initramfs/scripts
diff options
context:
space:
mode:
authorGarrett Fields <[email protected]>2018-10-10 11:46:22 -0400
committerBrian Behlendorf <[email protected]>2018-10-10 08:46:22 -0700
commit5b3bfd86a4acd0fd572802de6eb8bfed322dd470 (patch)
tree8d1eaff82d1448d49345b2c5714d4aac3c87c801 /contrib/initramfs/scripts
parent2ef0f8c3298ef02a68180fa3b16d84aa810a464a (diff)
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 <[email protected]> Reviewed-by: Tony Hutter <[email protected]> Reviewed-by: George Melikov <[email protected]> Reviewed-by: Richard Elling <[email protected]> Signed-off-by: Garrett Fields <[email protected]> Closes #8004
Diffstat (limited to 'contrib/initramfs/scripts')
-rw-r--r--contrib/initramfs/scripts/zfs.in2
1 files changed, 1 insertions, 1 deletions
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