diff options
author | Matthew Macy <[email protected]> | 2020-04-09 09:59:31 -0700 |
---|---|---|
committer | GitHub <[email protected]> | 2020-04-09 09:59:31 -0700 |
commit | 8b27e08ed8c6d854ee3c398773407dfac24d7578 (patch) | |
tree | 9db66d4f1e9ffe9555ac9bd6132e1eee6e1c5a1b /module/zfs | |
parent | 68dde63d138882860109178f4ab0b7b1b1bb3cfd (diff) |
Add separate field for indicating that spa is in middle of split
By default it's not possible to open a device already owned by an
active vdev. It's necessary to make an exception to this for vdev
split. The FreeBSD platform code will make an exception if
spa_is splitting is set to to true.
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Ryan Moeller <[email protected]>
Signed-off-by: Matt Macy <[email protected]>
Closes #10178
Diffstat (limited to 'module/zfs')
-rw-r--r-- | module/zfs/spa.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/module/zfs/spa.c b/module/zfs/spa.c index 72a54ebce..0d4646c15 100644 --- a/module/zfs/spa.c +++ b/module/zfs/spa.c @@ -7477,6 +7477,7 @@ spa_vdev_split_mirror(spa_t *spa, char *newname, nvlist_t *config, list_destroy(&vd_trim_list); newspa->spa_config_source = SPA_CONFIG_SRC_SPLIT; + newspa->spa_is_splitting = B_TRUE; /* create the new pool from the disks of the original pool */ error = spa_load(newspa, SPA_LOAD_IMPORT, SPA_IMPORT_ASSEMBLE); @@ -7554,6 +7555,7 @@ spa_vdev_split_mirror(spa_t *spa, char *newname, nvlist_t *config, spa_history_log_internal(newspa, "split", NULL, "from pool %s", spa_name(spa)); + newspa->spa_is_splitting = B_FALSE; kmem_free(vml, children * sizeof (vdev_t *)); /* if we're not going to mount the filesystems in userland, export */ |