Open lundman opened 3 years ago
What appears to happen is;
Pass 1;
zvol_create_minors_recursive()
- calls dmu_objset_find(DS_FIND_CHILDREN)
- and calls zvol_create_minors_cb() for BOTH zvols.
- but since they do not have keys loaded, zvol_create_minors_cb() just returns.
At this point, spa import calls to load the keys, the stack looks like;
0 99115 zvol_create_minors_cb:entry BOOM/vol1
zfs`dmu_objset_find_impl+0x389
zfs`zvol_create_minors_recursive+0x86
zfs`spa_keystore_load_wkey+0x28a
zfs`zfs_ioc_load_key+0x8e
Note here, that after the key has been loaded, it directly calls zvol_create_minors_cb()
with ONLY BOOM/vol1
!
It does not call again for BOOM/vol2
presumably as "now the key have been loaded".
We should possibly change it by;
zfs_ioc_load_key
is just called for BOOM/vol1
and nothing else. and spa_keystore_load_wkey()
only deals with that. Even if you call zfs_ioc_load_key
for BOOM/vol2
it will not call zvol_create_minors_cb
because it will error with EEXIST
.
This would work:
692d652
<zfs`zvol_create_minors_recursive (zvol.c:1188)> zvol_create_minors_recursive: on 'BOOM/disk1'
<zfs`zvol_add_clones (zvol.c:1084)> adding clone 'BOOM/disk2'
<zfs`zvol_os_create_minor (zvol_os.c:686)> zvol_os_create_minor: 'BOOM/disk1'
<zfs`zvol_os_create_minor (zvol_os.c:686)> zvol_os_create_minor: 'BOOM/disk2'
Only
BOOM/vol1
gets a /dev/diskX entry, andBOOM/vol2
does not. Both list keys asavailable
.This appears related to https://github.com/openzfs/zfs/issues/10603