From a5b464263bc1f9fd833272a9e691cd479bf47d5d Mon Sep 17 00:00:00 2001 From: nachtgeist Date: Fri, 8 Oct 2021 18:16:31 +0000 Subject: [PATCH] initramfs: use correct dataset for rootfs on rollback=1 When booting with root=zfs:rpool/myrootfs@foosnapshot rollback=1, myrootfs and its descendants get rolled back to foosnapshot, however ZFS_BOOTFS still contains myrootfs@foosnapshot instead of the actually desired value of myrootfs. Reviewed-by: Brian Behlendorf Reviewed-by: John Kennedy Signed-off-by: Daniel Reichelt Closes #12585 Closes #12586 --- contrib/initramfs/scripts/zfs | 1 + 1 file changed, 1 insertion(+) diff --git a/contrib/initramfs/scripts/zfs b/contrib/initramfs/scripts/zfs index 306e6e157e..35502291e6 100644 --- a/contrib/initramfs/scripts/zfs +++ b/contrib/initramfs/scripts/zfs @@ -630,6 +630,7 @@ setup_snapshot_booting() then # Rollback snapshot rollback_snap "$s" || retval=$((retval + 1)) + ZFS_BOOTFS="${rootfs}" else # Setup a destination filesystem name. # Ex: Called with 'rpool/ROOT/debian@snap2'