Skip to content

Commit 48e6bcc

Browse files
committed
Fix parent BE selection in snapshot_dispatcher
1 parent 4bd680e commit 48e6bcc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

90zfsbootmenu/zfsbootmenu-lib.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -967,7 +967,11 @@ snapshot_dispatcher() {
967967
zdebug "subkey: ${subkey}"
968968

969969
parent_ds="${selected%/*}"
970-
parent_ds="${selected%@*}"
970+
971+
# Generally, stripping "/*" from $selected will also drop the snapshot part;
972+
# however, if $selected is the root dataset, $parent_ds == $selected because
973+
# $selected contains no "/". In that case, the snapshot must be stripped too.
974+
parent_ds="${parent_ds%@*}"
971975

972976
if [ -z "${parent_ds}" ]; then
973977
zerror "unable to determine parent dataset for ${selected}"

0 commit comments

Comments
 (0)