From fa02e34c9bc3537e1e4f48de33a242bbf33d329c Mon Sep 17 00:00:00 2001 From: Matthew Macy Date: Fri, 3 Apr 2020 13:02:08 -0700 Subject: [PATCH] Clear spa_config_source when done with 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_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 --- module/zfs/spa.c | 1 + 1 file changed, 1 insertion(+) diff --git a/module/zfs/spa.c b/module/zfs/spa.c index 72a54ebcef2f..e18210e8b45f 100644 --- a/module/zfs/spa.c +++ b/module/zfs/spa.c @@ -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 */