I've added another commit to this which addresses an additional problem with 
device removal and mirrors:

Now that we support device removal with mirrors, it's reasonable to change the 
pool config while a removal is in progress. E.g. to "zpool attach", "zpool 
detach", or automatic spare in / out events. However, these operations cause 
panics because we save the vdev_t that is being removed in svr_vdev, but this 
vdev_t can be freed (e.g. if a detach changes the top-level vdev from a mirror 
to a plain disk).

The solution is to store the vdev ID in the spa_vdev_removal_t, rather than the 
vdev_t. Most places that the svr_vdev is used will have to use 
vdev_lookup_top() to obtain the vdev_t (in some cases adding additional calls 
to spa_config_enter/exit).



-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openzfs/openzfs/pull/591#issuecomment-376265987
------------------------------------------
openzfs: openzfs-developer
Permalink: 
https://openzfs.topicbox.com/groups/developer/discussions/T497ad70ebb1401b5-M73ff51e700772a1d7f257fbc
Delivery options: https://openzfs.topicbox.com/groups

Reply via email to