-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
dracut: Fix race condition between load-key and import #11500
Conversation
zfs-load-key.sh is called by the dracut-pre-mount.service unit which has no explicit 'After' dependency on zfs-import.target. That way it can be that the pool has not yet been imported and the zfs-load-key.sh finishes without ever seeing the relevant pool. Signed-off-by: Lorenz Hüdepohl <dev@stellardeath.org>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks reasonable to me based on the dracut documentation, but I haven't tested anything myself.
Debian does package dracut, and the Debian ZFS team packages zfs-dracut. I also personally use it on two ZFS on root machines. Now with the (recently merged) path change to zgenhostid, Debian doesn't change very much related to dracut. So I think this should work as well on Debian as anywhere else. Unfortunately, I don't have time right now to test this, though. |
Thanks for the feedback. I'll go ahead and merge this to master. |
zfs-load-key.sh is called by the dracut-pre-mount.service unit which has no explicit 'After' dependency on zfs-import.target. That way it can be that the pool has not yet been imported and the zfs-load-key.sh finishes without ever seeing the relevant pool. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Lorenz Hüdepohl <dev@stellardeath.org> Closes #11500
zfs-load-key.sh is called by the dracut-pre-mount.service unit which has no explicit 'After' dependency on zfs-import.target. That way it can be that the pool has not yet been imported and the zfs-load-key.sh finishes without ever seeing the relevant pool. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Lorenz Hüdepohl <dev@stellardeath.org> Closes openzfs#11500
zfs-load-key.sh is called by the dracut-pre-mount.service unit which has no explicit 'After' dependency on zfs-import.target. That way it can be that the pool has not yet been imported and the zfs-load-key.sh finishes without ever seeing the relevant pool. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Lorenz Hüdepohl <dev@stellardeath.org> Closes openzfs#11500
Motivation
Another dracut issue that surfaces for me on openSUSE. With this commit (and the recently merged #11487) I can boot from an encrypted dataset just fine.
(Note that I have a separate
/boot
partition with the kernels, as I don't want to deal with grub's zfs support for now)Description
zfs-load-key.sh is called by the dracut-pre-mount.service unit which has no explicit 'After' dependency on zfs-import.target. That way it can be that the pool has not yet been imported and the zfs-load-key.sh finishes without ever seeing the relevant pool.
How Has This Been Tested?
I build zfs packages for openSUSE, available at https://build.opensuse.org/project/show/home:lorenz:filesystems
This commit and the recently merged #11487 are included as a patch there, and the resulting packages are in active use by myself and a few others. With the patch, the affected dracut initrd zfs services are then active also on openSUSE.
Types of changes
Checklist:
Signed-off-by
.