Skip to content

Commit 04344d5

Browse files
nabijaczlewelibehlendorf
authored andcommitted
i-t: don't brokenly set the scheduler for root pool vdev's disks
This effectively reverts 4fc411f (part of #6807) and f6fbe25 (#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 (9e17e6f) ‒ use an udev rule Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11838
1 parent 46aec6d commit 04344d5

File tree

1 file changed

+0
-24
lines changed
  • contrib/initramfs/scripts

1 file changed

+0
-24
lines changed

contrib/initramfs/scripts/zfs

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -890,30 +890,6 @@ mountroot()
890890
ZFS_RPOOL="${pool}"
891891
fi
892892

893-
# Set the no-op scheduler on the disks containing the vdevs of
894-
# the root pool. For single-queue devices, this scheduler is
895-
# "noop", for multi-queue devices, it is "none".
896-
# ZFS already does this for wholedisk vdevs (for all pools), so this
897-
# is only important for partitions.
898-
"${ZPOOL}" status -L "${ZFS_RPOOL}" 2> /dev/null |
899-
awk '/^\t / && !/(mirror|raidz)/ {
900-
dev=$1;
901-
sub(/[0-9]+$/, "", dev);
902-
print dev
903-
}' |
904-
while read -r i
905-
do
906-
SCHEDULER=/sys/block/$i/queue/scheduler
907-
if [ -e "${SCHEDULER}" ]
908-
then
909-
# Query to see what schedulers are available
910-
case "$(cat "${SCHEDULER}")" in
911-
*noop*) echo noop > "${SCHEDULER}" ;;
912-
*none*) echo none > "${SCHEDULER}" ;;
913-
esac
914-
fi
915-
done
916-
917893

918894
# ----------------------------------------------------------------
919895
# P R E P A R E R O O T F I L E S Y S T E M

0 commit comments

Comments
 (0)