Skip to content

i-t: fix root=zfs:AUTO, don't attempt to badly set scheduler #11838

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 9 additions & 28 deletions contrib/initramfs/scripts/zfs
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ find_rootfs()

# Not boot fs here, export it and later try again..
"${ZPOOL}" export "$pool"
POOL_IMPORTED=""

POOL_IMPORTED=
ZFS_BOOTFS=
return 1
}

Expand Down Expand Up @@ -815,6 +815,11 @@ mountroot()
then
# Try to detect both pool and root fs.

# If we got here, that means we don't have a hint so as to
# the root dataset, but with root=zfs:AUTO on cmdline,
# this says "zfs:AUTO" here and interferes with checks later
ZFS_BOOTFS=

[ "$quiet" != "y" ] && \
zfs_log_begin_msg "Attempting to import additional pools."

Expand All @@ -832,8 +837,8 @@ mountroot()
do
[ -z "$pool" ] && continue

import_pool "$pool"
find_rootfs "$pool"
IFS="$OLD_IFS" import_pool "$pool"
IFS="$OLD_IFS" find_rootfs "$pool" && break
done
IFS="$OLD_IFS"

Expand Down Expand Up @@ -885,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
Expand Down