diff options
author | Tom Caputi <[email protected]> | 2019-05-25 16:46:32 -0400 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2019-05-25 13:46:32 -0700 |
commit | 8e3c3ed1b3b21d5510748a55852264c78fe24610 (patch) | |
tree | 93e0bb651173bccbea29a93412a2d90e9c72df3d /cmd | |
parent | bfd5a709e74dfe9358b339b4a17c4ad6567b85c7 (diff) |
Disable parallel processing for 'zfs mount -l'
Currently, 'zfs mount -a' will always attempt to parallelize
work related to mounting as best it can. Unfortunately, when
the user passes the '-l' option to load keys, this causes
all threads to prompt the user for their keys at once,
resulting in a confusing and racy user experience. This patch
simply disables parallel mounting when using the '-l' flag.
Reviewed by: Sebastien Roy <[email protected]>
Reviewed by: Brian Behlendorf <[email protected]>
Signed-off-by: Tom Caputi <[email protected]>
Closes #8762
Closes #8811
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/zfs/zfs_main.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/cmd/zfs/zfs_main.c b/cmd/zfs/zfs_main.c index 6929a2246..c85154479 100644 --- a/cmd/zfs/zfs_main.c +++ b/cmd/zfs/zfs_main.c @@ -6622,10 +6622,13 @@ share_mount(int op, int argc, char **argv) /* * libshare isn't mt-safe, so only do the operation in parallel - * if we're mounting. + * if we're mounting. Additionally, the key-loading option must + * be serialized so that we can prompt the user for their keys + * in a consistent manner. */ zfs_foreach_mountpoint(g_zfs, cb.cb_handles, cb.cb_used, - share_mount_one_cb, &share_mount_state, op == OP_MOUNT); + share_mount_one_cb, &share_mount_state, + op == OP_MOUNT && !(flags & MS_CRYPT)); ret = share_mount_state.sm_status; for (int i = 0; i < cb.cb_used; i++) |