]> git.proxmox.com Git - mirror_zfs.git/blobdiff - module/zfs/spa.c
Panic when running 'zpool split'
[mirror_zfs.git] / module / zfs / spa.c
index 9d798ebac4da375b41999dba5d2cd4055f11ca81..71744139e7cd032fb6c4277cc477b327421a6669 100644 (file)
@@ -6842,6 +6842,18 @@ spa_vdev_split_mirror(spa_t *spa, char *newname, nvlist_t *config,
                dmu_tx_abort(tx);
        for (c = 0; c < children; c++) {
                if (vml[c] != NULL) {
+                       vdev_t *tvd = vml[c]->vdev_top;
+
+                       /*
+                        * Need to be sure the detachable VDEV is not
+                        * on any *other* txg's DTL list to prevent it
+                        * from being accessed after it's freed.
+                        */
+                       for (int t = 0; t < TXG_SIZE; t++) {
+                               (void) txg_list_remove_this(
+                                   &tvd->vdev_dtl_list, vml[c], t);
+                       }
+
                        vdev_split(vml[c]);
                        if (error == 0)
                                spa_history_log_internal(spa, "detach", tx,