From 04344d5bc33e455200413ef5f4da95722f23ba6d Mon Sep 17 00:00:00 2001 From: наб Date: Sun, 4 Apr 2021 00:53:40 +0200 Subject: i-t: don't brokenly set the scheduler for root pool vdev's disks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This effectively reverts 4fc411f7a3ecee8a70fc8d6c687fae9a1cf20b31 (part of #6807) and f6fbe25664629d1ae6a3b186f14ec69dbe6c6232 (#9042) ‒ the code itself and latter PR cite symmetry with whole-disk-vdev behaviour (presumably because rootfs vdevs are rarely whole disks), but the code is broken for NVME devices (indeed, it'd strip the controller number instead of the (potential) partition number, turning "nvme0n1p1" into "nvmen1p1", which would then subsequently fail the sysfs existence check); it could be fixed to handle those (and any others) rather easily by dereferencing /sys/class/block/$devname, but this isn't the place for setting this ‒ as noted in the commit that removed setting the scheduler by default (9e17e6f2541c69a7a5e0ed814a7f5e71cbf8b90a) ‒ use an udev rule Reviewed-by: Brian Behlendorf Signed-off-by: Ahelenia Ziemiańska Closes #11838 --- contrib/initramfs/scripts/zfs | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/contrib/initramfs/scripts/zfs b/contrib/initramfs/scripts/zfs index 61090a912..377f9efca 100644 --- a/contrib/initramfs/scripts/zfs +++ b/contrib/initramfs/scripts/zfs @@ -890,30 +890,6 @@ mountroot() ZFS_RPOOL="${pool}" fi - # Set the no-op scheduler on the disks containing the vdevs of - # the root pool. For single-queue devices, this scheduler is - # "noop", for multi-queue devices, it is "none". - # ZFS already does this for wholedisk vdevs (for all pools), so this - # is only important for partitions. - "${ZPOOL}" status -L "${ZFS_RPOOL}" 2> /dev/null | - awk '/^\t / && !/(mirror|raidz)/ { - dev=$1; - sub(/[0-9]+$/, "", dev); - print dev - }' | - while read -r i - do - SCHEDULER=/sys/block/$i/queue/scheduler - if [ -e "${SCHEDULER}" ] - then - # Query to see what schedulers are available - case "$(cat "${SCHEDULER}")" in - *noop*) echo noop > "${SCHEDULER}" ;; - *none*) echo none > "${SCHEDULER}" ;; - esac - fi - done - # ---------------------------------------------------------------- # P R E P A R E R O O T F I L E S Y S T E M -- cgit v1.2.3