mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-27 03:19:35 +03:00
Panic when running 'zpool split'
Added missing remove of detachable VDEV from txg's DTL list to avoid use-after-free for the split VDEV Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Jorgen Lundman <lundman@lundman.net> Signed-off-by: Roman Strashkin <roman.strashkin@nexenta.com> Closes #5565 Closes #7856
This commit is contained in:
parent
2efea7c82c
commit
234234ca4d
@ -6842,6 +6842,18 @@ spa_vdev_split_mirror(spa_t *spa, char *newname, nvlist_t *config,
|
|||||||
dmu_tx_abort(tx);
|
dmu_tx_abort(tx);
|
||||||
for (c = 0; c < children; c++) {
|
for (c = 0; c < children; c++) {
|
||||||
if (vml[c] != NULL) {
|
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]);
|
vdev_split(vml[c]);
|
||||||
if (error == 0)
|
if (error == 0)
|
||||||
spa_history_log_internal(spa, "detach", tx,
|
spa_history_log_internal(spa, "detach", tx,
|
||||||
|
Loading…
Reference in New Issue
Block a user