Skip to content

Commit

Permalink
Clear spa_config_source when done with split
Browse files Browse the repository at this point in the history
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_config_source is set to SPA_CONFIG_SRC_SPLIT. To avoid
allowing this once the split is complete, set spa_config_source to
SPA_CONFIG_SRC_NONE.

Signed-off-by: Matt Macy <[email protected]>
  • Loading branch information
mattmacy committed Apr 3, 2020
1 parent 5a42ef0 commit fa02e34
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions module/zfs/spa.c
Original file line number Diff line number Diff line change
Expand Up @@ -7554,6 +7554,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_config_source = SPA_CONFIG_SRC_NONE;
kmem_free(vml, children * sizeof (vdev_t *));

/* if we're not going to mount the filesystems in userland, export */
Expand Down

0 comments on commit fa02e34

Please sign in to comment.