-
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
Iterate encrypted clones at zvol_create_minor #12471
Conversation
i mean.. "ping" ... |
Userland figures out which encryption-root keys are required to load, and issues ZFS_IOC_LOAD_KEY. The tail section of spa_keystore_load_wkey() will call zvol_create_minors() on the encryption-root object. Any clones of the encrypted zvol will not be plumbed. This commits adds additional logic to detect if zvol has clones, and is encrypted, then adds these to the list of zvols to call zvol_create_minors() on. Signed-off-by: Jorgen Lundman <[email protected]>
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.
Thanks for the reminder (and fix!) This looks good to me.
My one suggestion would be to add the test case you provided with the original PR. It looks like it would be easy enough to either extend cli_root/zpool_import/zpool_import_encrypted_load.ksh
, or to create a new ./cli_root/zpool_import/zpool_import_encrypted_vol.ksh
. The only mildly tricky bit should be checking that the volume appears in the right place for each platform. There are some existing tests which do this like zpool_create_014_neg.ksh
which you could borrow the right bits from.
Did not do a test, just mentioned it could do with a test, but it would be hard to do. One of those dream properties, what if we had:
It'd even be easier to do after the zvol symlinks land, since they'd exist if volumes got plumbed. |
Fair enough. With this fix this is the kind of test which I'd expect should work today on Linux and FreeBSD. But I don't think we need to hold up merging this for it. @mmaybee would you mind giving this a review so we can move it forward. |
Userland figures out which encryption-root keys are required to load, and issues ZFS_IOC_LOAD_KEY. The tail section of spa_keystore_load_wkey() will call zvol_create_minors() on the encryption-root object. Any clones of the encrypted zvol will not be plumbed. This commits adds additional logic to detect if zvol has clones, and is encrypted, then adds these to the list of zvols to call zvol_create_minors() on. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Jorgen Lundman <[email protected]> Closes openzfs#12471
Userland figures out which encryption-root keys are required to load, and issues ZFS_IOC_LOAD_KEY. The tail section of spa_keystore_load_wkey() will call zvol_create_minors() on the encryption-root object. Any clones of the encrypted zvol will not be plumbed. This commits adds additional logic to detect if zvol has clones, and is encrypted, then adds these to the list of zvols to call zvol_create_minors() on. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Jorgen Lundman <[email protected]> Closes openzfs#12471
Userland figures out which encryption-root keys are required to load, and issues ZFS_IOC_LOAD_KEY. The tail section of spa_keystore_load_wkey() will call zvol_create_minors() on the encryption-root object. Any clones of the encrypted zvol will not be plumbed. This commits adds additional logic to detect if zvol has clones, and is encrypted, then adds these to the list of zvols to call zvol_create_minors() on. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Jorgen Lundman <[email protected]> Closes openzfs#12471
Create device nodes for encrypted cloned zvols.
Userland figures out which encryption-root keys are required to load,
and issues ZFS_IOC_LOAD_KEY. The tail section of spa_keystore_load_wkey()
will call zvol_create_minors() on the encryption-root object.
Any clones of the encrypted zvol will not be plumbed. This commits
adds additional logic to detect if zvol has clones, and is encrypted,
then adds these to the list of zvols to call zvol_create_minors() on.
Motivation and Context
The old incorrect behavior is easily tested by;
and on import, it will plumb devices for
vol1
only,vol2
is left "unplumbed".This fixes openzfsonosx/openzfs#99 and possibly related issue #10603
Testing for that "plumbing" succeeds is not an easy task - on macOS we would iterate either
diskutil list
orioreg
for the existence of the created device nodes. Linux (I am guessing) udev is checked? FreeBSD,/dev/zvol/
? So each platform would have its own test needed for a tester.Description
How Has This Been Tested?
Types of changes
Checklist:
Signed-off-by
.