Skip to content

Commit

Permalink
Exchanged two "${ZFS} get -H -o value" commands
Browse files Browse the repository at this point in the history
Initramfs uses "get_fs_value()" elsewhere.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Richard Laager <rlaager@wiktel.com>
Reviewed-by: Kjeld Schouten-Lebbing <kjeld@schouten-lebbing.nl>
Signed-off-by: Garrett Fields <ghfields@gmail.com>
Closes openzfs#9736
  • Loading branch information
ghfields authored and tonyhutter committed Dec 26, 2019
1 parent 9038a39 commit d0d1a07
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions contrib/initramfs/scripts/zfs.in
Original file line number Diff line number Diff line change
Expand Up @@ -410,11 +410,11 @@ decrypt_fs()
if [ "$(zpool list -H -o feature@encryption $(echo "${fs}" | awk -F\/ '{print $1}'))" = 'active' ]; then

# Determine dataset that holds key for root dataset
ENCRYPTIONROOT=$(${ZFS} get -H -o value encryptionroot "${fs}")
ENCRYPTIONROOT="$(get_fs_value "${fs}" encryptionroot)"

# If root dataset is encrypted...
if ! [ "${ENCRYPTIONROOT}" = "-" ]; then
KEYSTATUS="$(${ZFS} get -H -o value keystatus "${ENCRYPTIONROOT}")"
KEYSTATUS="$(get_fs_value "${ENCRYPTIONROOT}" keystatus)"
# Continue only if the key needs to be loaded
[ "$KEYSTATUS" = "unavailable" ] || return 0
TRY_COUNT=3
Expand Down

0 comments on commit d0d1a07

Please sign in to comment.